[Pkg-nethack-devel] Bug#216454: nethack-gnome: ^C during the game puts program into a loop
Dave Cohrs
Dave Cohrs <d.cohrs@computer.org>, 216454@bugs.debian.org
Sat, 18 Oct 2003 17:58:56 -0700
The infinite loop is actually in the gnome or gtk library itself. There's
a stack trace below cut against the official 3.4.2 source (which may or may
not have the same line numbers as the debian source).
The call to gnome_dialog_run_and_close() in frame #8 never returns. I'm
guessing gnome/gtk is not reentrant, since at the time the signal was
received nethack was already in an event loop (see frame #18), but the
behavior in the library is still pretty suboptimal for looping instead of
passing this back up.
As a workaround, set the "ignintr" option when you use the Gnome interface.
> GLib-WARNING **: g_main_iterate(): main loop already active in another thread
This message is misleading. Nethack is single-threaded on Linux.
dave
#0 0x420d69c8 in write () from /lib/i686/libc.so.6
#1 0x40bec4d0 in __JCR_LIST__ () from /usr/lib/libglib-1.2.so.0
#2 0x40bdc2da in g_logv () from /usr/lib/libglib-1.2.so.0
#3 0x40bdc464 in g_log () from /usr/lib/libglib-1.2.so.0
#4 0x40bd9f22 in g_main_iterate () from /usr/lib/libglib-1.2.so.0
#5 0x40bda0f4 in g_main_run () from /usr/lib/libglib-1.2.so.0
#6 0x409cd6df in gtk_main () from /usr/lib/libgtk-1.2.so.0
#7 0x40867f83 in gnome_dialog_run_real () from /usr/lib/libgnomeui.so.32
#8 0x40868179 in gnome_dialog_run_and_close () from /usr/lib/libgnomeui.so.32
#9 0x081dcfc2 in ghack_yes_no_dialog (question=0x8246b0d "Really quit?",
choices=0x823c798 "yn", def=110) at ../win/gnome/gnyesno.c:66
#10 0x081d07e3 in gnome_yn_function (question=0x8246b0d "Really quit?",
choices=0x823c798 "yn", def=110) at ../win/gnome/gnbind.c:1047
#11 0x0807d8d8 in yn_function (query=0x8246b0d "Really quit?",
resp=0x823c798 "yn", def=110 'n') at cmd.c:2498
#12 0x080ba9ec in done2 () at end.c:115
#13 0x080ba9d0 in done1 (sig_unused=2) at end.c:106
#14 0x40cc674e in __pthread_sighandler () from /lib/i686/libpthread.so.0
#15 <signal handler called>
#16 0x420db167 in poll () from /lib/i686/libc.so.6
#17 0x40bda3cb in g_main_poll () from /usr/lib/libglib-1.2.so.0
#18 0x40bd9c95 in g_main_iterate () from /usr/lib/libglib-1.2.so.0
#19 0x40bda063 in g_main_iteration () from /usr/lib/libglib-1.2.so.0
#20 0x409cd978 in gtk_main_iteration () from /usr/lib/libgtk-1.2.so.0
#21 0x081d0583 in gnome_nh_poskey (x=0xbffff334, y=0xbffff330, mod=0xbffff32c)
at ../win/gnome/gnbind.c:948
#22 0x0807d736 in readchar () at cmd.c:2371
#23 0x0807d497 in parse () at cmd.c:2288
#24 0x0807bdf3 in rhack (cmd=0x0) at cmd.c:1768
#25 0x0806126f in moveloop () at allmain.c:408
#26 0x081cc346 in main (argc=5, argv=0xbffff504) at ../sys/unix/unixmain.c:286
#27 0x420158f7 in __libc_start_main () from /lib/i686/libc.so.6