After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615992 - $SIG{CHLD}='IGNORE' + FileChooserDialog cause crash
$SIG{CHLD}='IGNORE' + FileChooserDialog cause crash
Status: RESOLVED NOTABUG
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2010-04-16 21:10 UTC by Torsten Schoenfeld
Modified: 2010-05-16 12:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (1.63 KB, application/x-perl)
2010-04-16 21:10 UTC, Torsten Schoenfeld
Details

Description Torsten Schoenfeld 2010-04-16 21:10:25 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.

Thread NaN (LWP 20374)

  • #0 ??
  • #1 _gnome_vfs_canonicalize_pathname
    from /usr/lib/libgnomevfs-2.so.0
  • #2 <signal handler called>
  • #3 __kernel_vsyscall
  • #4 ___newselect_nocancel
    from /lib/libc.so.6
  • #5 _XEnq
    from /usr/X11R6/lib/libX11.so.6
  • #6 _XRead
    from /usr/X11R6/lib/libX11.so.6
  • #7 _XReply
    from /usr/X11R6/lib/libX11.so.6
  • #8 XkbGetState
    from /usr/X11R6/lib/libX11.so.6
  • #9 gdk_keymap_get_entries_for_keyval
    from /usr/lib/libgdk-x11-2.0.so.0
  • #10 gdk_keymap_get_direction
    from /usr/lib/libgdk-x11-2.0.so.0
  • #11 gdk_screen_get_setting
    from /usr/lib/libgdk-x11-2.0.so.0
  • #12 gdk_screen_get_setting
    from /usr/lib/libgdk-x11-2.0.so.0
  • #13 gdk_screen_get_setting
    from /usr/lib/libgdk-x11-2.0.so.0
  • #14 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #15 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #16 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #17 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #18 XS_Gtk2_main
    from /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/auto/Gtk2/Gtk2.so
  • #19 Perl_pp_entersub
    from /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so
  • #20 Perl_runops_debug
    from /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so
  • #21 perl_run
    from /usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE/libperl.so
  • #22 main
The program is running. Exit anyway? (y or n) y
[alex@srv64 perl]$
Comment 1 Torsten Schoenfeld 2010-04-16 21:11:07 UTC
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.
Comment 2 Torsten Schoenfeld 2010-05-16 12:54:52 UTC
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".