Delivered-To: lablgtk at yquem.inria.fr Date: Tue, 27 Nov 2007 10:23:55 +0900 (JST) Message-Id: <20071127.102355.71562806.garrigue at math.nagoya-u.ac.jp> To: bsd at cs.ubc.ca, lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] SIGSEGV with lablgtk for GTK+ 2 From: Jacques Garrigue In-Reply-To: <20071126204522.GA8290 at monolith.gateway.2wire.net> References: <20071126204522.GA8290 at monolith.gateway.2wire.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: Text/Plain; charset=us-ascii Content-Length: 2712 From: Brian de Alwis > Hello everybody. I'm not an ocaml or lablgtk user, but rather a > happy user of unison. I'm not cc'd to this list, so I've redirected > replies to both myself and the list. > > I recently did a big recompile including ocaml, lablgtk, and unison. > I use pkgsrc.org. unison now cores with a SIGSEGV when trying to > use its lablgtk-based UI ('graphics' mode): > > (gdb) where > #0 0xbb5516b2 in g_type_fundamental () from /usr/pkg/lib/libgobject-2.0.so.0 > #1 0x08172e85 in ml_G_TYPE_FUNDAMENTAL () > #2 0x080ce208 in camlGobject__objtype_from_name_256 () > #3 0x762cb901 in ?? () > #4 0x0818aad4 in camlUigtk2__187 () > #5 0x762cb901 in ?? () > #6 0x081f8fbc in camlGtkBaseProps__150 () > #7 0x081f2640 in camlGobject__114 () > #8 0x080ce405 in camlGobject__unsafe_create_290 () > [...] > > Unison works fine in text mode. This looks like an initialisation problem. What version of unison are you using? > Poking into this problem a bit further, almost all of lablgtk's > example programs crash in the same way *except* for about.ml. The > crash traces generally look like: > > (gdb) run -I ../src -w s tree.ml > Starting program: /tmp/obj/x11/lablgtk/work/lablgtk-2.10.0/src/lablgtktop -I ../src -w s tree.ml > > Program received signal SIGSEGV, Segmentation fault. > 0xbb48c6b2 in g_type_fundamental () from /usr/pkg/lib/libgobject-2.0.so.0 > (gdb) bt > #0 0xbb48c6b2 in g_type_fundamental () from /usr/pkg/lib/libgobject-2.0.so.0 > #1 0x080a8aff in ml_G_TYPE_FUNDAMENTAL (arg1=1967197825) at ml_gobject.c:87 > #2 0x080c9a0f in caml_interprete () > #3 0x080baae5 in caml_main () > #4 0x080bace1 in main () All examples have to be run with gtk initialized. That is, it should be ../src/lablgtktop -I ../src gtkInit.cmo -w s tree.ml about.ml just happens to do the initialization by itself. Usually forgetting gtkInit.cmo results in a lot of critical warnings: (process:55391): GLib-GObject-WARNING **: invalid (NULL) pointer instance (process:55391): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed .... It looks like debian chose to disable warnings, so you only get a very helpful segfault. Since unison does not always initialize gtk (no need in text mode), this should be done only in ui mode, by calling "GMain.init ()". On the other hand, it is surprising that there should be such a trivial bug in unison, so the reason may be different. Jacques _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk