How can I find out where is my code causing GLib-GObject-CRITICAL?

后端 未结 3 368
时光说笑
时光说笑 2021-01-12 15:45

When a C/C++ application fails with the following CRITICAL, can you please tell me how can I find out where is the code causing the error?

I have tried to run it in

相关标签:
3条回答
  • 2021-01-12 15:59

    You should pass --g-fatal-warnings to your application when you run it inside gdb.

    0 讨论(0)
  • 2021-01-12 16:15

    You can break on g_log and then do a backtrace from there.

    0 讨论(0)
  • 2021-01-12 16:16

    I think it does show where it is causing the problem (deeper in the stack trace):

    (gdb) bt
    #0  0x00da5422 in __kernel_vsyscall ()
    #1  0x00c70e15 in pthread_cond_wait@@GLIBC_2.3.2 ()
        at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122
    #2  0x008a5800 in g_once_init_enter_impl () from /lib/libglib-2.0.so.0
    #3  0x00800e36 in g_initially_unowned_get_type ()
       from /usr/lib/libgobject-2.0.so.0
    #4  0x00271f15 in gtk_object_get_type () from /usr/lib/libgtk-x11-2.0.so.0
    #5  0x0036aa4c in gtk_widget_get_type () from /usr/lib/libgtk-x11-2.0.so.0
    #6  0x001b8485 in gtk_container_get_type () from /usr/lib/libgtk-x11-2.0.so.0
    #7  0x0031b3b5 in gtk_toolbar_get_type () from /usr/lib/libgtk-x11-2.0.so.0
    #8  0x0031d717 in gtk_toolbar_new () from /usr/lib/libgtk-x11-2.0.so.0
    
    0 讨论(0)
提交回复
热议问题