本文介绍了我如何知道我的代码在哪里导致GLib-GObject-CRITICAL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有试图在调试器中运行它,试图在程序失败时执行'bt。但它没有显示导致CRITICAL的代码在哪里:

$ p $ (process:3155):GLib-GObject-CRITICAL ** :/build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458:初始化断言失败,在函数

(进程:3155)之前使用IA__g_type_init():GLib- CRITICAL **:g_once_init_leave:assertion`initialization_value!= 0'失败

(进程:3155):GLib-GObject-CRITICAL **:/build/buildd/glib2.0-2.22.3/gobject /gtype.c:2458:初始化断言失败,请在此函数

(进程:3155)之前使用IA__g_type_init():GLib-GObject-CRITICAL **:/build/buildd/glib2.0- 2.22.3 / gobject / gtype.c:2458:初始化断言失败,在这个函数
$ b(进程:3155)之前使用IA__g_type_init():GLib-GObject-CRITICAL **:/ build / buildd /glib2.0-2.22.3/gobject/gtype.c:2458:初始化断言失败,在此函数

(进程:3155)之前使用IA__g_type_init():GLib-GObject-CRITICAL ** :g_type_add_interface_static:as (进程:3155):GLib-GObject-CRITICAL **:/build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458 :初始化断言失败,在此函数之前使用IA__g_type_init()


解决方案

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


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 the debugger, trying to do a 'bt when the program fails. But it does not show where is the code causing the 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
解决方案

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

这篇关于我如何知道我的代码在哪里导致GLib-GObject-CRITICAL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 21:00