From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8874 invoked by alias); 16 Aug 2002 22:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 8860 invoked by uid 71); 16 Aug 2002 22:06:01 -0000 Date: Fri, 16 Aug 2002 15:26:00 -0000 Message-ID: <20020816220601.8859.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tom Tromey Subject: Re: libgcj/7532: shutdown hooks not run upon abnormal termination Reply-To: Tom Tromey X-SW-Source: 2002-08/txt/msg00342.txt.bz2 List-Id: The following reply was made to PR libgcj/7532; it has been noted by GNATS. From: Tom Tromey To: Cc: gcc-gnats@gcc.gnu.org, Andrew Haley 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