[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems with glib or Scintilla



On Tue, Aug 02, 2005 at 10:56:33AM +0100, Raw Data wrote:
> I've been getting segmentation faults on screem and gPHPEdit on Sarge.

> The problems seem to be with glib or scintilla. I've contacted both
> authors of the software, but I was wondering if someone is
> experiencing the same problems.
> Here's the full gdb output for gPHPEdit and screem:

> gPHPEdit:

> (gdb) thread apply all bt
> (gdb) directory /usr/src/glib2.0-2.6.4/upstream/tarballs/glib-2.6.4/gobject/
> Source directories searched:
> /usr/src/glib2.0-2.6.4/upstream/tarballs/glib-2.6.4/gobject:$cdir:$cwd
> (gdb) run
> Starting program: /usr/bin/gphpedit
> (no debugging symbols found)
> .............................
> (no debugging symbols found)
> [Thread debugging using libthread_db enabled]
> [New Thread 16384 (LWP 17998)]
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 16384 (LWP 17998)]
> 0x0000020001219068 in IA__g_type_is_a (type=541201296,
> iface_type=4832844736) at gtype.c:2731
> 2731      if (/* support_inheritance && */
> (gdb) bt full
> #0  0x0000020001219068 in IA__g_type_is_a (type=541201296,
> iface_type=4832844736) at gtype.c:2731
> No locals.
> #1  0x0000020000ca90d8 in gtk_type_new () from /usr/lib/libgtk-x11-2.0.so.0
> No symbol table info available.
> #2  0x0000000120068084 in scintilla_new ()
> No symbol table info available.
> #3  0x0000000120053420 in gtk_scintilla_get_type ()
> No symbol table info available.

I'm *so* glad these kinds of coding idiocies are now fatal errors with
gcc 4.0...

The attached patch fixes the error in gPHPEdit (actually in the included
scintilla code.... why does gPHPEdit embed scintilla code? :P).  This
package is completely unusable on 64-bit architectures due to this
bone-headed, why-would-you-do-that-when-that's-not-what-the-API-docs-say
error.  This warrants a grave bug against gphpedit.

Unfortunately, after fixing this bug I get another segfault with a much,
much less useful backtrace; and there's also bug #315539, which may or may
not be related.  Clearly, gphpedit should never have been included in a
stable release in this state, but apparently it didn't get much testing
before sarge went out the door.

> And here is the same for screem:

> (gdb) bt full
> #0  0x000002000124dfa4 in IA__g_type_fundamental
> (type_id=543153936) at gtype.c:3112
> No locals.
> #1  0x000002000122e6c0 in IA__g_object_new
> (object_type=543153936, first_property_name=0x0) at
> gobject.c:820
>         var_args = {__base = 0x12013a25b, __offset = 538157912}
> #2  0x0000000120044844 in screem_combo_box_new ()
> No symbol table info available.
> #3  0x00000001200c66c4 in screem_window_close ()
> No symbol table info available.
> #4  0x000002000122ee90 in IA__g_object_newv
> (object_type=4836532352, n_parameters=1,
> parameters=0x12046acb0) at gobject.c:725
>         contents = (gchar *) 0x120501c60 "\200 G \001"
>         cparams = (GObjectConstructParam *) 0x120502840
>         oparams = (GObjectConstructParam *) 0x120502810
>         nqueue = (GObjectNotifyQueue *) 0x12046acb0
>         object = (GObject *) 0x120501760
>         class = (GObjectClass *) 0x120501c60
>         unref_class = (GObjectClass *) 0x0
>         slist = (GSList *) 0x120373e80
>         n_total_cparams = 2
>         n_cparams = 2
>         n_oparams = 1
>         n_cvalues = 0
>         cvalues = (GValue *) 0x120502870
>         clist = (GList *) 0x120501760
>         i = 0
> #5  0x000002000122f3d8 in IA__g_object_new_valist
> (object_type=4836532352, first_property_name=0x0,
> var_args={__base = 0x11ffff480, __offset = 48}) at
> gobject.c:1026
>         _cvalue = (GTypeCValue *) 0x120231620
>         pspec = (GParamSpec *) 0x40
>         class = (GObjectClass *) 0x120501c60
>         params = (GParameter *) 0x1204ebc30
>         name = (const gchar *) 0x0
>         object = (GObject *) 0x1204ebc50
>         n_params = 2
>         n_alloced_params = 16
> #6  0x000002000122e744 in IA__g_object_new
> (object_type=4836532352, first_property_name=0x120138964
> "app") at gobject.c:823
>         var_args = {__base = 0x11ffff480, __offset = 16}
> #7  0x000000012003d4bc in screem_application_create_window ()
> No symbol table info available.
> #8  0x000000012003e558 in screem_application_startup ()
> No symbol table info available.
> #9  0x000000012006a69c in main ()
> No symbol table info available.
> (gdb)  quit
> The program is running.  Exit anyway? (y or n) y

This looks suspiciously like the same kind of bug, but I don't have the
patience to track down yet another inexcusable coding error tonight.

-- 
Steve Langasek
postmodern programmer
only in patch2:
unchanged:
--- gphpedit-0.9.50.orig/src/gtkscintilla2/scintilla/gtk/ScintillaGTK.cxx
+++ gphpedit-0.9.50/src/gtkscintilla2/scintilla/gtk/ScintillaGTK.cxx
@@ -2120,8 +2120,8 @@
 extern void Platform_Initialise();
 extern void Platform_Finalise();
 
-guint scintilla_get_type() {
-	static guint scintilla_type = 0;
+GType scintilla_get_type() {
+	static GType scintilla_type = 0;
 
 	if (!scintilla_type) {
 		Platform_Initialise();
only in patch2:
unchanged:
--- gphpedit-0.9.50.orig/src/gtkscintilla2/scintilla/include/ScintillaWidget.h
+++ gphpedit-0.9.50/src/gtkscintilla2/scintilla/include/ScintillaWidget.h
@@ -34,7 +34,7 @@
 	void (* notify) (ScintillaObject *ttt);
 };
 
-guint		scintilla_get_type	(void);
+GType		scintilla_get_type	(void);
 GtkWidget*	scintilla_new		(void);
 void		scintilla_set_id	(ScintillaObject *sci,int id);
 sptr_t		scintilla_send_message	(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);

Attachment: signature.asc
Description: Digital signature


Reply to: