GNOME Bugzilla – Bug 567658
Glib::Child->watch_add run exception handlers
Last modified: 2021-07-05 12:22:15 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;
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.