G_TYPE_CHECK_INSTANCE, GLib-GObject-CRITICAL, gsignal.c

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
snowsquirrel
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Dec 30, 2004 11:37 pm

G_TYPE_CHECK_INSTANCE, GLib-GObject-CRITICAL, gsignal.c

Post by snowsquirrel »

I finally got the wx app, pgadmin3, up and running. Exactly what I wanted, great. But it core dumps all the time; on exit, resize, cancel a dialog, closing help dialog. The error and warning messages are always the same leading up to the crash. Here is example stdout from a run before a core dump:
(pgadmin3:28738): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer

(pgadmin3:28738): GLib-GObject-CRITICAL **: file gsignal.c: line 1926: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(pgadmin3:28738): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer

(pgadmin3:28738): GLib-GObject-CRITICAL **: file gsignal.c: line 1926: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(pgadmin3:28738): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer

(pgadmin3:28738): GLib-GObject-CRITICAL **: file gsignal.c: line 1926: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(pgadmin3:28738): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `<invalid>'

(pgadmin3:28738): GLib-GObject-CRITICAL **: file gsignal.c: line 1926: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(pgadmin3:28738): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer

(pgadmin3:28738): GLib-GObject-CRITICAL **: file gsignal.c: line 1926: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(pgadmin3:28738): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `<invalid>'

(pgadmin3:28738): GLib-GObject-CRITICAL **: file gsignal.c: line 1926: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
Segmentation Fault (core dumped)

I couldn't find anything in the archives relating to the this. What has gone wrong here? If I need to provide more information, just let me know. These look more like wx errors to me, than pgadmin errors. Am I barking up the wrong tree? The pgadmin list is doesn't really seem to know, but none of them are complaining of this problem. I build wx with --enable-unicode, and --enable-debug, on top of gtk2.4.9

~S
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

Seeing a backtrace might help.

Code: Select all

gdb pgadming
set args --g-fatal-warnings
run
.... crash ...
bt
<paste relevant output here>
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
snowsquirrel
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Dec 30, 2004 11:37 pm

Post by snowsquirrel »

Unfortunately there is no gdb for Solaris 10 x86 b72, that I know of yet. Will a pstack doo? I will look into getting a Solaris 10, AMD64 gdb, but ...

Code: Select all

$ pstack core
core 'core' of 29322:   ./pgadmin3
 fe202a8c strlen   (fffffffffdd13aa3, 80467ac, 80462a0, 0) + c
 fe25ae2b vsnprintf (80462e8, 1, fffffffffdd13a74, 80467ac, 8ad4588, 0) + 73
 fd379cda g_printf_string_upper_bound () + 1a
snowsquirrel
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Dec 30, 2004 11:37 pm

Post by snowsquirrel »

ok, I got gdb built installed. But when I run with the arg --g-fatal-warnings it crashes in a different place.

Here is a bt without --g-fatal-warnings:
Program received signal SIGSEGV, Segmentation fault.
0xfe202a8c in strlen () from /usr/lib/libc.so.1
(gdb) bt
#0 0xfe202a8c in strlen () from /usr/lib/libc.so.1
#1 0xfe257d2c in _ndoprnt () from /usr/lib/libc.so.1
#2 0xfe25ae2b in vsnprintf () from /usr/lib/libc.so.1
#3 0xfd379cda in g_printf_string_upper_bound () from /usr/lib/libglib-2.0.so.0
And here is the output with --get-fatal-warnings:
Program received signal SIGABRT, Aborted.
0xfe27d867 in _lwp_kill () from /usr/lib/libc.so.1
(gdb) bt
#0 0xfe27d867 in _lwp_kill () from /usr/lib/libc.so.1
#1 0xfe27b14a in thr_kill () from /usr/lib/libc.so.1
#2 0xfe22add7 in raise () from /usr/lib/libc.so.1
#3 0xfe20e929 in abort () from /usr/lib/libc.so.1
#4 0xfd37923e in g_logv () from /usr/lib/libglib-2.0.so.0
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

In both cases the problem is further down the stack than you pasted. Paste until some of the wx calls in there.
with --g-fatal-warnings you can usually get to see the problem, not the consequence further in the longrun.
With --g-fatal-warnings you will of course see the abort and kill calls on top of the stack as we can see in your paste (abort, raise, _lwp_kill and so on)
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
snowsquirrel
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Dec 30, 2004 11:37 pm

Post by snowsquirrel »

(gdb) bt 20
#0 0xfe27d867 in _lwp_kill () from /usr/lib/libc.so.1
#1 0xfe27b14a in thr_kill () from /usr/lib/libc.so.1
#2 0xfe22add7 in raise () from /usr/lib/libc.so.1
#3 0xfe20e929 in abort () from /usr/lib/libc.so.1
#4 0xfd37923e in g_logv () from /usr/lib/libglib-2.0.so.0
(gdb)
The most I can get is 5 stack frames. Is there something else I can do? We use dbx with Sun's workshop gui, so I don't know much about gdb. Unfortunately dbx can read gdb debugging symbols.

~S
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

You can instruct gcc what debugging information type to use
man gcc wrote: -g Produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or
DWARF). GDB can work with this debugging information.

On most systems that use stabs format, -g enables use of extra debugging information that only GDB
can use; this extra information makes debugging work better in GDB but will probably make other
debuggers crash or refuse to read the program. If you want to control for certain whether to gener-
ate the extra information, use -gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).
Additionally
further below wrote: -gdwarf-2
Produce debugging information in DWARF version 2 format (if that is supported). This is the format
used by DBX on IRIX 6.
5 steps backtrace here is so not enough
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
snowsquirrel
Earned a small fee
Earned a small fee
Posts: 19
Joined: Thu Dec 30, 2004 11:37 pm

Post by snowsquirrel »

5 steps backtrace here is so not enough
How do I get more? I did a "bt 20", which should give me no more than 20.

~S
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

I wonder if that isn't the whole backtrace then for some odd reason.
With set args --g-fatal-warnings I'm quite sure there should be more.
It's hard to help for me without seeing the backtrace or something else informative, as I haven't seen that gtk+ warning myself anywhere in that context, and the warning is very wide-meaning, so without a backtrace I have no idea about what it is about.
Do various wx samples work without problems, etc. If they do it smells like a problem in pgadmin.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
waterj
Earned a small fee
Earned a small fee
Posts: 21
Joined: Mon Nov 07, 2005 8:39 am

I sm running into the same problem

Post by waterj »

leio wrote:I wonder if that isn't the whole backtrace then for some odd reason.
With set args --g-fatal-warnings I'm quite sure there should be more.
It's hard to help for me without seeing the backtrace or something else informative, as I haven't seen that gtk+ warning myself anywhere in that context, and the warning is very wide-meaning, so without a backtrace I have no idea about what it is about.
Do various wx samples work without problems, etc. If they do it smells like a problem in pgadmin.
I am running into the same problem and really confused.

wxWidgets2.6.2:
platform: solaris 10 for sparc(actually a sun blade 2000), gtk+ 2.8.4, glib 2.8.3
wxWidgets configured with: --enable-debug --enable-html --with-gtk=2 --with-opengl
run samples/dialogs, select file menu -> select "Property Sheet Dialog" -> press ok button then the program crashs! I hav tried some other samples and found out the crash happens when press ok button on dialogs too.

please help!

gdb backtrace shows:
#0 0xfdc2ea90 in strlen () from /lib/libc.so.1
#1 0xfdf8bb9c in _g_gnulib_vasnprintf () from /opt/csw/lib/libglib-2.0.so.0
#2 0xfdf8dd78 in _g_gnulib_vasprintf () from /opt/csw/lib/libglib-2.0.so.0
#3 0xfdf85dcc in g_vasprintf () from /opt/csw/lib/libglib-2.0.so.0
#4 0xfdf687f8 in g_strdup_vprintf () from /opt/csw/lib/libglib-2.0.so.0
#5 0xfdf51954 in g_logv () from /opt/csw/lib/libglib-2.0.so.0
#6 0xfdf51a64 in g_log () from /opt/csw/lib/libglib-2.0.so.0
#7 0xfe54cc30 in g_type_check_instance ()
from /opt/csw/lib/libgobject-2.0.so.0
#8 0xfe53d920 in g_signal_handlers_disconnect_matched ()
from /opt/csw/lib/libgobject-2.0.so.0
#9 0xfd4730e0 in set_ic_client_window ()
from /opt/csw/lib/gtk-2.0/2.4.0/immodules/im-xim.so
#10 0xfd472e9c in gtk_im_context_xim_finalize ()
from /opt/csw/lib/gtk-2.0/2.4.0/immodules/im-xim.so
#11 0xfe52a568 in g_object_unref () from /opt/csw/lib/libgobject-2.0.so.0
#12 0xfe1a5d00 in gtk_im_multicontext_set_slave ()
from /opt/csw/lib/libgtk-x11-2.0.so.0
#13 0xfe1a5bec in gtk_im_multicontext_finalize ()
from /opt/csw/lib/libgtk-x11-2.0.so.0
#14 0xfe52a568 in g_object_unref () from /opt/csw/lib/libgobject-2.0.so.0
#15 0xfefdc3dc in ~wxGtkIMData (this=0x23bbb0) at ../src/gtk/window.cpp:1144
#16 0xfedac134 in ~wxWindow (this=0xffbfdd18) at ../src/gtk/window.cpp:2922
#17 0xfeedc7c0 in ~wxTopLevelWindowBase (this=0xffbfdd18)
at ../src/common/toplvcmn.cpp:74
#18 0xfed9e1b8 in ~wxTopLevelWindowGTK (this=0xffbfdd18)
at ../src/gtk/toplevel.cpp:738
#19 0x0002c2b4 in ~wxTopLevelWindow (this=0xffbfdd18) at dialog.h:39
#20 0x0002c260 in ~wxDialogBase (this=0xffbfdd18) at dialog.h:40
#21 0x0002c20c in ~wxDialog (this=0xffbfdd18) at dialog.h:52
#22 0x0002d668 in ~wxPropertySheetDialog (this=0xffbfdd18)
at ../../../samples/dialogs/dialogs.cpp:978
#23 0x0002d6bc in ~SettingsDialog (this=0xffbfdd18)
at ../../../samples/dialogs/dialogs.cpp:978
#24 0x00025478 in MyFrame::OnPropertySheet (this=0x126188)
at ../../../samples/dialogs/dialogs.cpp:979
#25 0xfea6b814 in wxAppConsole::HandleEvent (this=0x5aa28, handler=0x126188,
func=
{__pfn = 0x25408 <MyFrame::OnPropertySheet(wxCommandEvent&)>, __delta = 0}, event=@0xffbfe168) at ../src/common/appbase.cpp:324
#26 0xfeb27db4 in wxEvtHandler::ProcessEventIfMatches (entry=@0x4972c,
handler=0x126188, event=@0xffbfe168) at ../src/common/event.cpp:1193
#27 0xfeb26670 in wxEventHashTable::HandleEvent (this=0x4948c,
event=@0xffbfe168, self=0x126188) at ../src/common/event.cpp:875
#28 0xfeb28128 in wxEvtHandler::ProcessEvent (this=0x126188, event=@0xffbfe168)
at ../src/common/event.cpp:1255
#29 0xfee15d0c in gtk_menu_clicked_callback (widget=0x141628, menu=0x12d7a0)
at ../src/gtk/menu.cpp:651
#30 0xfe522794 in g_closure_invoke () from /opt/csw/lib/libgobject-2.0.so.0
#31 0xfe53fbd4 in signal_emit_unlocked_R ()
from /opt/csw/lib/libgobject-2.0.so.0
#32 0xfe53edb0 in g_signal_emit_valist () from /opt/csw/lib/libgobject-2.0.so.0
#33 0xfe53f124 in g_signal_emit () from /opt/csw/lib/libgobject-2.0.so.0
#34 0xfe328d58 in gtk_widget_activate () from /opt/csw/lib/libgtk-x11-2.0.so.0
#35 0xfe1e29c0 in gtk_menu_shell_activate_item ()
from /opt/csw/lib/libgtk-x11-2.0.so.0
#36 0xfe1e17c0 in gtk_menu_shell_button_release ()
from /opt/csw/lib/libgtk-x11-2.0.so.0
#37 0xfe1cd668 in _gtk_marshal_BOOLEAN__BOXED ()
from /opt/csw/lib/libgtk-x11-2.0.so.0
#38 0xfe522794 in g_closure_invoke () from /opt/csw/lib/libgobject-2.0.so.0
#39 0xfe53fe00 in signal_emit_unlocked_R ()
from /opt/csw/lib/libgobject-2.0.so.0
#40 0xfe53ee08 in g_signal_emit_valist () from /opt/csw/lib/libgobject-2.0.so.0
#41 0xfe53f124 in g_signal_emit () from /opt/csw/lib/libgobject-2.0.so.0
#42 0xfe32854c in gtk_widget_event () from /opt/csw/lib/libgtk-x11-2.0.so.0
#43 0xfe1cbc94 in gtk_propagate_event () from /opt/csw/lib/libgtk-x11-2.0.so.0
#44 0xfe1ca7d8 in gtk_main_do_event () from /opt/csw/lib/libgtk-x11-2.0.so.0
#45 0xfe75b94c in gdk_event_dispatch () from /opt/csw/lib/libgdk-x11-2.0.so.0
#46 0xfdf44220 in g_main_dispatch () from /opt/csw/lib/libglib-2.0.so.0
#47 0xfdf45ad8 in g_main_context_dispatch () from /opt/csw/lib/libglib-2.0.so.0
#48 0xfdf46150 in g_main_context_iterate () from /opt/csw/lib/libglib-2.0.so.0
#49 0xfdf46ac8 in g_main_loop_run () from /opt/csw/lib/libglib-2.0.so.0
#50 0xfe1c9b40 in gtk_main () from /opt/csw/lib/libgtk-x11-2.0.so.0
#51 0xfed8d5a8 in wxEventLoop::Run (this=0x2044d0) at ../src/gtk/evtloop.cpp:80
#52 0xfee40ca8 in wxAppBase::MainLoop (this=0x5aa28)
at ../src/common/appcmn.cpp:272
#53 0xfee40ec8 in wxAppBase::OnRun (this=0x5aa28)
at ../src/common/appcmn.cpp:340
#54 0xfeab3004 in wxEntry (argc=@0xffbff304, argv=0xffbff324)
at ../src/common/init.cpp:439
#55 0x0001f994 in main (argc=1, argv=0xffbff324)
at ../../../samples/dialogs/dialogs.cpp:297
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

M.J.Wetherell just recently fixed this bug in CVS two days ago.
CVS log message for changed files: "The Sun customised version of Pango shipping with Solaris 10 crashes if the language is left NULL (bug 1374114)"

http://sourceforge.net/tracker/index.ph ... tid=109863
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
waterj
Earned a small fee
Earned a small fee
Posts: 21
Joined: Mon Nov 07, 2005 8:39 am

Post by waterj »

leio wrote:M.J.Wetherell just recently fixed this bug in CVS two days ago.
CVS log message for changed files: "The Sun customised version of Pango shipping with Solaris 10 crashes if the language is left NULL (bug 1374114)"

http://sourceforge.net/tracker/index.ph ... tid=109863
I've got a snapshot of new version and it worked fine. Thanks for help, leio.
Now I really wonder when the 2.7 version will be released?
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

In the not-so-close future, and 2.7 is a development series, not (API) stable.
This workaround will appear in 2.6.3 too, once its released, which has been planned to be done soon (but the discussion seems to have faded away right now, I'll ping in a couple days probably)
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
waterj
Earned a small fee
Earned a small fee
Posts: 21
Joined: Mon Nov 07, 2005 8:39 am

Post by waterj »

leio wrote:In the not-so-close future, and 2.7 is a development series, not (API) stable.
This workaround will appear in 2.6.3 too, once its released, which has been planned to be done soon (but the discussion seems to have faded away right now, I'll ping in a couple days probably)
Thanks for help!
I am a liitle worring about the time frame of my project now.
Post Reply