Bug#295194: libglib2.0-0: segfault in g_option_context_add_main_entries
Torsten Marek
Torsten Marek <shlomme@gmx.net>, 295194@bugs.debian.org
Mon, 14 Feb 2005 11:18:05 +0100
Package: libglib2.0-0
Version: 2.6.2-1
Severity: normal
This little program makes gtk/glib segfault:
## start ##
#include <gtk/gtk.h>
int main(int argc, char** argv)
{
char** myargv = (char**)malloc(sizeof(char*)*3);
int myargc = 2;
myargv[0] = "test";
myargv[1] = "-calendar";
myargv[2] = 0;
gtk_init(&myargc, &myargv);
return 0;
}
## end ##
Backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xb7b60266 in g_option_context_add_main_entries () from /usr/lib/libglib-2.0.so.0
(gdb) backtrace
#0 0xb7b60266 in g_option_context_add_main_entries () from /usr/lib/libglib-2.0.so.0
#1 0xb7b60443 in g_option_context_parse () from /usr/lib/libglib-2.0.so.0
#2 0xb7e1c78e in gtk_parse_args () from /usr/lib/libgtk-x11-2.0.so.0
#3 0xb7e1c7c6 in gtk_init_check () from /usr/lib/libgtk-x11-2.0.so.0
#4 0xb7e1c816 in gtk_init () from /usr/lib/libgtk-x11-2.0.so.0
#5 0x0804875d in main (argc=1, argv=0xbffff824) at checkargs.c:12
If I change "-calendar" into "--calendar", no segmentation violation takes place.
This bug occurs when running mozilla-sunbird (both prebuilt versions from mozilla.org
and cvs builds).
greetings
Torsten
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-ck5
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Versions of packages libglib2.0-0 depends on:
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
-- no debconf information