From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 43E8E3858C2F; Mon, 1 Jan 2024 23:11:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43E8E3858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704150718; bh=jJYzjg8VW8CaQjPbCC6Fnd2XO7EC22TJqtojnYu6QxE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FhSBCQuZI+A76zoJf/Eb+S2X4L59nTZi4wRndMlzpyuNbyuRsfrHK08y4lcBgTCXa Bena7Mb3/vp5oI6b14V7taMRuS1MxdDs4QRmzZALDeG2Q/feRy5GepZzQi8YutNldk ZIzV1uA90GR5sAwo/4eYMsVjqT65matjl2ceZkk0= From: "ssbssa at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/16505] internal SIGFPE busy-CPU locks up GDB Date: Mon, 01 Jan 2024 23:11:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ssbssa at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D16505 Hannes Domani changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ssbssa at sourceware dot o= rg --- Comment #2 from Hannes Domani --- (In reply to Sourceware Commits from comment #1) > The master branch has been updated by Andrew Burgess > : >=20 > https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git; > h=3Dfb550a919a88bf4e3950dd7bcdf72f0a18d94206 >=20 > commit fb550a919a88bf4e3950dd7bcdf72f0a18d94206 > Author: Andrew Burgess > Date: Thu Jun 10 10:44:43 2021 +0100 >=20 > gdb: terminate upon receipt of SIGFPE >=20=20=20=20=20 > GDB's SIGFPE handling is broken, this is PR gdb/16505 and > PR gdb/17891. >=20=20=20=20=20 > We currently try to use an async event token to process SIGFPE. So, > when a SIGFPE arrives the signal handler calls > mark_async_signal_handler then returns, effectively ignoring the > signal (for now). >=20=20=20=20=20 > The intention is that later the event loop will see that the async > token associated with SIGFPE has been marked and will call the async > handler, which just throws an error. >=20=20=20=20=20 > The problem is that SIGFPE is not safe to ignore. Ignoring a > SIGFPE (unless it is generated artificially, e.g. by raise()) is > undefined behaviour, after ignoring the signal on many targets we > return to the instruction that caused the SIGFPE to be raised, which > immediately causes another SIGFPE to be raised, we get stuck in an > infinite loop. The behaviour is certainly true on x86-64. >=20=20=20=20=20 > To view this behaviour I simply added some dummy code to GDB that > performed an integer divide by zero, compiled this on x86-64 > GNU/Linux, ran GDB and saw GDB hang. >=20=20=20=20=20 > In this commit, I propose to remove all special handling of SIGFPE and > instead just let GDB make use of the default SIGFPE action, that is, > to terminate the process. >=20=20=20=20=20 > The only user visible change here should be: >=20=20=20=20=20 > - If a user sends a SIGFPE to GDB using something like kill, > previously GDB would just print an error and remain alive, now GDB > will terminate. This is inline with what happens if the user > sends GDB a SIGSEGV from kill though, so I don't see this as an > issue. >=20=20=20=20=20 > - If a bug in GDB causes a real SIGFPE, previously the users GDB > session would hang. Now the GDB session will terminate. Again, > this is inline with what happens if GDB receives a SIGSEGV due to > an internal bug. >=20=20=20=20=20 > In bug gdb/16505 there is mention that it would be nice if GDB did > more than just terminate when receiving a fatal signal. I haven't > done that in this commit, but later commits will move in that > direction. >=20=20=20=20=20 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D16505 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D17891 Can this be closed now? --=20 You are receiving this mail because: You are on the CC list for the bug.=