gtk_init - freezing/crashing



OK, I have two issues with gtk_init () that I can't seem to figure out...

I'm working on a GTK+ interface for Xine (xine.sourceforge.net).  I'm
leaving as much of the existing infrastructure as is, if possible, so here
is one problem I have: Xine only gives the GUI a list of filenames for the
playlist.  Not the full argc/argv.  I therefore have nothing to pass to
gtk_init().  If I pass nothing to gtk_init(), or just the list of filenames
for the playlist (and an integer of the count of items in the list, like
argc does for argv), I get a segfault:

Program received signal SIGSEGV, Segmentation fault.
gdk_init_check (argc=0xbffff6e0, argv=0xbffff6e4) at gdk.c:429
429	gdk.c: No such file or directory.
(gdb) backtrace
#0  gdk_init_check (argc=0xbffff6e0, argv=0xbffff6e4) at gdk.c:429
#1  0x402e302b in gtk_init_check (argc=0xbffff6e0, argv=0xbffff6e4) at
gtkmain.c:247
#2  0x402e3437 in gtk_init (argc=0xbffff6e0, argv=0xbffff6e4) at
gtkmain.c:471
#3  0x808877c in gui_start ()
#4  0x8051c96 in main ()

Now, if I do pass in some values, gtk_init() more or less freezes - it
never returns.  Interrupting gtk_init while it's in the debugger gives:

Program received signal SIGINT, Interrupt.
0x403f517e in sigsuspend () from /lib/libc.so.6
(gdb) backtrace
#0  0x403f517e in sigsuspend () from /lib/libc.so.6
#1  0x400491a0 in pthread_setconcurrency () from /lib/libpthread.so.0
#2  0x4004a8ee in sem_destroy () from /lib/libpthread.so.0
#3  0x40047ad1 in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x401a8acc in XInitThreads () from /usr/X11R6/lib/libX11.so.6
#5  0x403d186c in XGetExtensionVersion () from /usr/X11R6/lib/libXi.so.6
#6  0x403d392d in _XiCheckExtInit () from /usr/X11R6/lib/libXi.so.6
#7  0x403d240c in XListInputDevices () from /usr/X11R6/lib/libXi.so.6
#8  0x40394021 in gdk_input_common_init (include_core=0) at
gdkinputcommon.h:454
#9  0x40394b65 in gdk_input_init () at gdkinputxfree.h:69
#10 0x40381b22 in gdk_init_check (argc=0xbffff6d0, argv=0xbffff6d4) at
gdk.c:461
#11 0x402e302b in gtk_init_check (argc=0xbffff6d0, argv=0xbffff6d4) at
gtkmain.c:247
#12 0x402e3437 in gtk_init (argc=0xbffff6d0, argv=0xbffff6d4) at
gtkmain.c:471
#13 0x808877c in gui_start ()
#14 0x8051c96 in main ()

Xine is threaded quite a bit.  The GUI is running in the main thread, while
video/audio/etc. threads are spawned off - they do not interact with the
GUI (yet, though I plan on doing that in a thread safe way).

What could be causing this?  How can I use gtk_init() without access to
argc/argv, or do I need to make Xine pass these to the GUI code?

BTW, I'm not sure if I'm on the gtk-devel-list (I don't think I am), so
pleasae respond to my e-mail address (sean middleditch iname com).

Thanks

-- 
Sean Middleditch
  of
AwesomePlay Productions, Inc.





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