简体   繁体   English

我怎样才能找出导致GLib-GObject-CRITICAL的代码在哪里?

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

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? 当C / C ++应用程序因以下CRITICAL而失败时,您能告诉我如何找出导致错误的代码在哪里?

I have tried to run it in the debugger, trying to do a 'bt when the program fails. 我试图在调试器中运行它,尝试在程序失败时执行'bt'。 But it does not show where is the code causing the CRITICAL: 但它没有显示导致CRITICAL的代码在哪里:

(process:3155): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458: initialization assertion failed, use IA__g_type_init() prior to this function

(process:3155): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

(process:3155): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458: initialization assertion failed, use IA__g_type_init() prior to this function

(process:3155): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458: initialization assertion failed, use IA__g_type_init() prior to this function

(process:3155): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458: initialization assertion failed, use IA__g_type_init() prior to this function

(process:3155): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(process:3155): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458: initialization assertion failed, use IA__g_type_init() prior to this function

你可以打破g_log然后从那里做回溯。

在gdb中运行时,应该将--g-fatal-warnings传递给应用程序。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何找到旧版GLIB的安装位置? - How to find where older version of GLIB has been installed? 内核代码:在哪里可以找到以及如何调试内核 - Kernel Code : where can I find and how to debug the kernel 我在哪里可以找到mmap的源代码? - Where can I find the source code for mmap? 在glib的GObject中,我混淆了从父类派生的子类的实例对象是否继承了父类的属性? - in GObject of glib I confuse that whether the instance object of subclass that derive from parent class inherit properties of parent class or not? 如何在Java代码中查找文件 - How can I find a file while in my java code 我的应用程序有128MB的堆,但是使用1.6GB的实际RAM。 如何找到1.4GB的存储空间? - My app has 128MB heap but uses 1.6GB of real RAM. How can I find out where the 1.4GB go to? 是否可以防止Linux用户空间pthread在关键代码中产生? - Can I prevent a Linux user space pthread yielding in critical code? 如何找出适合由 shell 脚本解析的 linux 机器的总物理内存 (RAM)? - How can I find out the total physical memory (RAM) of my linux box suitable to be parsed by a shell script? 在哪里可以找到系统调用源代码? - Where can I find system call source code? 在哪里可以找到特定的 Linux 系统库的源代码? - Where can I find specific Linux system libraries' source code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM