GNOME Bugzilla – Bug 615992
$SIG{CHLD}='IGNORE' + FileChooserDialog cause crash
Last modified: 2010-05-16 12:54:52 UTC
Created attachment 158921 [details] test case I'm filing this on behalf of an anonymous user who submitted it to SF.net's tracker: System: Fedora Core 4 (kernel 2.6.13-1.1526_FC4) Perl: 5.8.6-15 perl-Gtk2-GladeXML-1.005-1 perl-Glib-1.100-1 perl-Gtk2-1.100-1 If a perl program does the following sequence of events: $SIG{CHLD} = 'IGNORE'; calls socketpair() to create a pair of Unix sockets; fork()s a child process that dup()s one of the sockets to STDIN and STDOUT, then exec()s an arbitrary command (for the purpose of controlling said process via the other socket); displays a main window with Gtk2; displays a FileChooserDialog() as a response to any event on the main window (say a button press); on any moment during or after the FileChooserDialog display, the parent process causes the child process to terminate (say, via a command issued through the socket, or with a kill()), or if the child process terminates by itself without any parent intervention; ... then the application crashes at the moment the child process terminates. If the application never displays the FileChooserDialog, and terminates the child process, there is no crash. If the application does not issue the $SIG{CHLD}='IGNORE', and does all the other steps, there is no crash. This is the backtrace of the crash as seen by gdb: [alex@srv64 perl]$ gdb perl GNU gdb Red Hat Linux (6.3.0.0-1.21rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". (gdb) set args Gtk2-FileChooser-test.pl (gdb) run Starting program: /usr/bin/perl Gtk2-FileChooser-test.pl Reading symbols from shared object read from target memory...(no debugging symbols found)...done. Loaded system supplied DSO at 0xcdd000 (no debugging symbols found) (no debugging symbols found) ... (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1208550496 (LWP 20374)] (no debugging symbols found) (no debugging symbols found) ... (no debugging symbols found) Detaching after fork from child process 20379. (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) Entering sub loadDir... (no debugging symbols found) (no debugging symbols found) ... (no debugging symbols found) [New Thread -1211561040 (LWP 20384)] [New Thread -1211970640 (LWP 20385)] You aborted. Leaving sub loadDir... gatito lindo Program received signal SIGSEGV, Segmentation fault.
+ Trace 221418
Thread NaN (LWP 20374)
The program is running. Exit anyway? (y or n) y [alex@srv64 perl]$
muppet commented: Sorry for not answering this sooner; there's no way to mark the sourceforge project page with a notice that we use bugzilla.gnome.org instead. The backtrace shows _gnome_vfs_canonicalize_pathname() being called from a signal handler. This implies that there is other code in the stack using signals and handlers, and that your app code's setting of IGNORE for SIGCHLD is interfering with that. However, Gtk2-Perl itself does nothing with unix signals, beyond using a mainloop event source to ensure that unix signals cause perl to get control from gtk_main(). So, i suspect the problem lies either in gnome-vfs or in perl.
I can't reproduce the issue on my system now. Since the bug report is also very old and we haven't heard back from the reporter, I'm closing this as "not a bug".