segfault hacking
| From: | Rasmus Lerdorf | Date: | Thu, 05 Jul 2001 10:12:06 +0000 |
| Subject: | segfault hacking | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-2044@lists.php.net to get a copy of this message | ||
Hey Andrei, I don't know if you ran across this yet, but I got bored on
yet another plane ride and figured I'd solve this silly php-gtk segfault
that has been bugging me for a while.
Here it is:
(gdb) run gtk.php
Starting program: /usr/local/bin/php gtk.php
Program received signal SIGSEGV, Segmentation fault.
0x40535dd3 in strlen () from /lib/i686/libc.so.6
(gdb) bt
#0 0x40535dd3 in strlen () from /lib/i686/libc.so.6
#1 0x40438c31 in g_strdup () from /usr/kerberos/lib/libgssapi_krb5.so.2
#2 0x40872752 in g_get_any_init () at gutils.c:423
#3 0x40872bc0 in g_get_home_dir () at gutils.c:623
#4 0x40962795 in gtk_rc_append_default_module_path () at gtkrc.c:295
#5 0x40962c0e in gtk_rc_init () at gtkrc.c:462
#6 0x4093d499 in gtk_init_check (argc=0xbfffe374, argv=0xbfffe378) at gtkmain.c:440
#7 0x407702e0 in init_gtk () from /usr/local/lib/php/php_gtk.so
#8 0x407705d3 in php_rinit_gtk () from /usr/local/lib/php/php_gtk.so
#9 0x080f9241 in php_dl (file=0x84c74ec, type=2, return_value=0x84c752c) at dl.c:189
#10 0x080f8f06 in php_if_dl (ht=1, return_value=0x84c752c, this_ptr=0x0, return_value_used=0) at
dl.c:79
#11 0x0819559b in execute (op_array=0x8430f6c) at ./zend_execute.c:1573
#12 0x0816dd04 in zend_execute_scripts (type=8, file_count=3) at zend.c:750
#13 0x08083354 in php_execute_script (primary_file=0xbffff900) at main.c:1265
#14 0x08081214 in main (argc=2, argv=0xbffff9b4) at cgi_main.c:748
#15 0x404cc177 in __libc_start_main (main=0x80808ec <main>, argc=2, ubp_av=0xbffff9b4,
init=0x807e1c8 <_init>, fini=0x82a7630 <_fini>,
rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff9ac) at
../sysdeps/generic/libc-start.c:129
The clue is the /usr/kerberos/lib/libgssapi_krb5.so.2 reference. On
RH-7.x the imap library is linked against kerberos. If I remove imap
support from the php build then php-gtk works just fine.
I don't know the gtk api at all, but this g_strdup() call from the
kerberos library looks awefully suspicious. I assume g_strdup is some
sort of gnome/gtk strdup() function. Doesn't make any sense to me that
this would be called from the kerberos lib. There must be plenty of apps
out there linking imap support into gtk apps, so there should be a
solution available. Can't really google for it from here though...
-Rasmus