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 567658 - Glib::Child->watch_add run exception handlers
Glib::Child->watch_add run exception handlers
Status: RESOLVED OBSOLETE
Product: gnome-perl
Classification: Bindings
Component: Glib
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on: 568460
Blocks:
 
 
Reported: 2009-01-13 21:26 UTC by Kevin Ryde
Modified: 2021-07-05 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kevin Ryde 2009-01-13 21:26:39 UTC
The subprocess termination handler as setup by Glib::Child->watch_add could helpfully trap errors to the Glib->install_exception_handler mechanism, the same way idle, timeout and IO handlers work under a main loop.

(The difference being GPerlCallback instead of the GClosure stuff.)


use Glib;
use strict;
use warnings;

my $pid = fork();
if ($pid == 0) { sleep 1; exit 0 };

Glib->install_exception_handler (sub {
                                   print "exception trapped\n";
                                   return 1;
                                 });

Glib::Child->watch_add ($pid, sub {
                          print "child process stopped\n";
                          die "now throw an error";
                        });

my $mainloop = Glib::MainLoop->new;
$mainloop->run;
Comment 1 GNOME Infrastructure Team 2021-07-05 12:22:15 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME?utf8=%E2%9C%93&filter=perl-

Thank you for your understanding and your help.