This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libgcj/7532: shutdown hooks not run upon abnormal termination
- From: Tom Tromey <tromey at redhat dot com>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 16 Aug 2002 22:06:01 -0000
- Subject: Re: libgcj/7532: shutdown hooks not run upon abnormal termination
- Reply-to: Tom Tromey <tromey at redhat dot com>
The following reply was made to PR libgcj/7532; it has been noted by GNATS.
From: Tom Tromey <tromey@redhat.com>
To: <jmr@fulcrummicro.com>
Cc: gcc-gnats@gcc.gnu.org, Andrew Haley <aph@redhat.com>
Subject: Re: libgcj/7532: shutdown hooks not run upon abnormal termination
Date: 16 Aug 2002 16:02:16 -0600
jmr> Shutdown hooks added with Runtime.addShutdownHook() are not run
jmr> if the program terminates abnormally, ie due to Ctrl-C.
Yeah, definitely a bug.
jmr> Here's a patch that installs a signal handler to catch SIGHUP, SIGINT, and
jmr> SIGTERM. The handler calls System.exit() so the shutdown hooks run.
jmr> Installation of the signal handlers can be disabled with
jmr> --reduce-signal-usage.
I don't think we can do this stuff directly from the signal handler.
I'm not sure what a better approach is though. Maybe Andrew has an idea.
I also don't think we need a gij command-line argument to reduce
signal usage.
Tom