Menu

#103 Critical warnings when build libmirage

open
nobody
None
unassigned
default
2017-03-23
2017-03-19
Zenitur
No

Libmirage is successfully build but GCC tell about critical bugs.

1 Attachments

Discussion

  • Zenitur

    Zenitur - 2017-03-19

    I had tried two GCC versions: 4.3 and 4.8. And I looked for patches in Ubuntu PPA and Gentoo.A patch named 01_g_assert_nonnull.diff doesn't fix a problem.

     
  • Rok Mandeljc

    Rok Mandeljc - 2017-03-19

    I think this is the core issue (after fixing the g_assert_nonnull() with the 01_g_asert_nonnull.diff): warning: implicit declaration of function 'g_data_input_stream_read_line_utf8'

    That function was introduced in glib-2.30, which means that we are incorrectly setting minimum required version to 2.28 (which is also the version you are trying to build with).

    I guess even at the time when we started using g_data_input_stream_read_line_utf8, glib 2.30+ was already prevalent enough for the issue to slip unnoticed...

    If you still wish to compile with glib 2.28, you can try replacing all calls to g_data_input_stream_read_line_utf8() with g_data_input_stream_read_line(). (You still need to apply 01_g_assert_nonull.diff, though).

     
  • Zenitur

    Zenitur - 2017-03-19

    Thank you! I will make a workaround patch.

     
  • Zenitur

    Zenitur - 2017-03-20
     
    • Rok Mandeljc

      Rok Mandeljc - 2017-03-20

      A similar issue; g_thread_try_new() and g_thread_unref() were introduced in glib-2.32. They replace the obsolete g_thread_create().

      To make it work with 2.28, you should:
      a) remove the call to g_thread_unref() - apparently it should be redundant either way, because the call to g_thread_join() should release the reference...
      b) replace the g_thread_try_new() with g_thread_create() - in audio.c (line 154), we have a similar situation, and we correctly handle both old and new API based on glib version. The device-kernel-io.c is missing a similar #if block.

      I will try to install SLE11 in a VM during the weekend to do some testing and see if these workarounds work well enough that we can continue specifying 2.28 as minimum version (as opposed to bumping the requirements to 2.32).

       

      Last edit: Rok Mandeljc 2017-03-20
  • Zenitur

    Zenitur - 2017-03-21

    Rok, thank you. You can try CentOS 6 instead of SLE 11. I see that Glib version is 2.28: http://mirror.yandex.ru/centos/6.8/os/x86_64/Packages/ CentOS is easier to install and configuring than SLE.

     
    • Rok Mandeljc

      Rok Mandeljc - 2017-03-22

      OK, thanks for the heads up - CentOS will be more familiar for me anyway.

       
  • Zenitur

    Zenitur - 2017-03-21

    Really, don't try SLE 11. There is Glib 2.22.5 by default, 2.28 is placed in Packman repository used by 99% users. Also it's hard to get ISO, hovewer CentOS ISO is easy to get.

    I make changes you told, and now cdemu-daemon is successfully builds. There is non-critical warning that doesn't break anything:

    [   36s] [ 57%] Building C object CMakeFiles/cdemu-daemon.dir/src/daemon-dbus.c.o
    [   36s] /usr/bin/gcc  -DHAVE_CONFIG_H -D_POSIX_C_SOURCE -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables  -O3 -DNDEBUG -I/usr/src/packages/BUILD/cdemu-daemon-3.0.5/build -isystem /usr/include/libmirage-3.0 -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include    -std=c99 -Wall -Wextra -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -o CMakeFiles/cdemu-daemon.dir/src/daemon-dbus.c.o -c /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/daemon-dbus.c
    [   36s] /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/device-kernel-io.c: In function 'cdemu_device_start':
    [   36s] /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/device-kernel-io.c:257:5: warning: passing argument 1 of 'g_thread_create_full' from incompatible pointer type [enabled by default]
    [   36s]      self->priv->io_thread = g_thread_create("I/O thread", (GThreadFunc)cdemu_device_io_thread, self, &local_error);
    [   36s]      ^
    [   36s] In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:34:0,
    [   36s]                  from /usr/include/glib-2.0/glib.h:34,
    [   36s]                  from /usr/include/glib-2.0/gobject/gbinding.h:30,
    [   36s]                  from /usr/include/glib-2.0/glib-object.h:25,
    [   36s]                  from /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/cdemu.h:40,
    [   36s]                  from /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/device-kernel-io.c:20:
    [   36s] /usr/include/glib-2.0/glib/gthread.h:224:10: note: expected 'GThreadFunc' but argument is of type 'char *'
    [   36s]  GThread* g_thread_create_full  (GThreadFunc            func,
    [   36s]           ^
    [   36s] /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/device-kernel-io.c:257:5: warning: passing argument 4 of 'g_thread_create_full' makes integer from pointer without a cast [enabled by default]
    [   36s]      self->priv->io_thread = g_thread_create("I/O thread", (GThreadFunc)cdemu_device_io_thread, self, &local_error);
    [   36s]      ^
    [   36s] In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:34:0,
    [   36s]                  from /usr/include/glib-2.0/glib.h:34,
    [   36s]                  from /usr/include/glib-2.0/gobject/gbinding.h:30,
    [   36s]                  from /usr/include/glib-2.0/glib-object.h:25,
    [   36s]                  from /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/cdemu.h:40,
    [   36s]                  from /usr/src/packages/BUILD/cdemu-daemon-3.0.5/src/device-kernel-io.c:20:
    [   36s] /usr/include/glib-2.0/glib/gthread.h:224:10: note: expected 'gboolean' but argument is of type 'struct CdemuDevice *'
    [   36s]  GThread* g_thread_create_full  (GThreadFunc            func,
    [   36s]           ^
    
     
    • Rok Mandeljc

      Rok Mandeljc - 2017-03-22

      This won't work, even if it compiles - the new g_thread_new and g_thread_create have different arguments!

      Former line 257 should have been expanded to an #if block like this:

      #if !GLIB_CHECK_VERSION(2, 32, 0)
          self->priv->io_thread = g_thread_create((GThreadFunc)cdemu_device_io_thread, self, TRUE, &local_error);
      #else
          self->priv->io_thread = g_thread_try_new("I/O thread", (GThreadFunc)cdemu_device_io_thread, self, &local_error);
      #endif
      
       
  • Zenitur

    Zenitur - 2017-03-23

    And the last package, cdemu-client.

     cdemu
    Traceback (most recent call last):
      File "/usr/bin/cdemu", line 29, in <module>
        import gi
    ImportError: No module named gi
    

    I have python-gobject2 2.20. python-gi was appear in python-gobject 2.21.4. I can make upgrade, but I want ask: can Gnome-Introspection be an optional dependency for this application? Like it was made for cdemu-daemon.

     

    Last edit: Zenitur 2017-03-23
    • Rok Mandeljc

      Rok Mandeljc - 2017-03-26

      I am afraid gobject-introspection is mandatory, because it is used for GDBus python bindings.

      For the cdemu-client, the transition from old python-dbus to GDBus was done between 3.0.1 and 3.0.3, so you could try packaging 3.0.1 instead if GDBus/gobject-introspection are not available.

      (I guess gcdemu is completely out of question due to gobject-introspection and Gtk3.)

       

Log in to post a comment.

MongoDB Logo MongoDB