From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20380 invoked by alias); 27 Jun 2004 17:15:22 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20373 invoked from network); 27 Jun 2004 17:15:21 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sourceware.org with SMTP; 27 Jun 2004 17:15:21 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i5RHFCM1000667; Sun, 27 Jun 2004 19:15:12 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i5RHFCU2007955; Sun, 27 Jun 2004 19:15:12 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i5RHFARS007952; Sun, 27 Jun 2004 19:15:10 +0200 (CEST) Date: Sun, 27 Jun 2004 17:15:00 -0000 Message-Id: <200406271715.i5RHFARS007952@elgar.kettenis.dyndns.org> From: Mark Kettenis To: ian@wasabisystems.com CC: cagney@gnu.org, mec.gnu@mindspring.com, david@streamline-computing.com, gdb-patches@sources.redhat.com In-reply-to: (message from Ian Lance Taylor on 27 Jun 2004 11:06:19 -0400) Subject: Re: [Patch] x % 0 hangs References: <20040626154420.265CD4B104@berman.michael-chastain.com> <200406262252.i5QMqJGP000626@elgar.kettenis.dyndns.org> <40DE0454.1020908@gnu.org> X-SW-Source: 2004-06/txt/msg00602.txt.bz2 From: Ian Lance Taylor Date: 27 Jun 2004 11:06:19 -0400 Andrew Cagney writes: > > The only approach that's somewhat > > portable is longjmp-ing out of the signal handler, and even that seems > > to have its problems on some platforms. > > I'm curious, which platforms? Over the years I've seen quite a few bug-reports about this failing to work, but I can't remember exectly which platforms were affected. It may be related to what I say in the next paragraph though. Anyway, if/when we start longjmp-ing out of signal handlers we have to realize the we must restore the proper signal mask (not all sigjmp/longjmp implementations do that) and perhaps re-install the SIGFPE signal handler. I would think that it would be safe enough to longjmp on SIGFPE into the gdb catch_errors stack. You would obviously be in trouble if the SIGFPE came from any libc stdio routine, but I would expect that to be impossible with a working library. The worst case is that we'll crash, which still is an improvement over just hanging like we do now on some platforms :-). Mark