public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: andrew.burgess@embecosm.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/5] gdb: print backtrace on fatal SIGSEGV
Date: Sun, 4 Jul 2021 16:03:55 +0100	[thread overview]
Message-ID: <8b0aeebb-2fff-35e3-f068-d4967bf1540c@palves.net> (raw)
In-Reply-To: <83v95qgn5g.fsf@gnu.org>

On 2021-07-04 3:38 p.m., Eli Zaretskii wrote:
>> From: Pedro Alves <pedro@palves.net>
>> Cc: andrew.burgess@embecosm.com, gdb-patches@sourceware.org
>> Date: Sun, 4 Jul 2021 15:32:19 +0100
>>
>> That was the answer.  The patch does not remove the "internal error ..."
>> message, there was never any.  It does not add one either.  Before the patch, GDB
>> dumps core (w/ SIGABRT), and after patch it prints a backtrace and then
>> dumps core (w/ SIGSEGV).
> 
> Shouldn't we add the "internal error" message?  That's what those
> fatal signals are, after all, right?
> 

Can you clarify what you mean by "message"?  When we talk about that, I'm thinking
that you're talking about the whole shebang, including the querying whether to exit
and dump core, like:

(gdb) maint internal-error 
../../gdb/maint.c:91: internal-error: 
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

../../gdb/maint.c:91: internal-error: 
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Command aborted.
(gdb) 


All this querying isn't async-signal-safe, we couldn't do it from the signal handler.

We can of course print something similar to just the parts without a query:

 A problem internal to GDB has been detected,
 further debugging may prove unreliable.

 This is a bug, please report it.  For instructions, see:
 <http://www.gnu.org/software/gdb/bugs/>.

Maybe say a "fatal signal" instead of "problem internal", something like that.

The patch doesn't do that, but it does sound like a good idea to make it do it.

This is the sort of detail that made me ask for an example of what the backtrace
looks like.

  reply	other threads:[~2021-07-04 15:03 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 11:06 [PATCH 0/5] GDB Synchronous Signal Handling Andrew Burgess
2021-07-02 11:06 ` [PATCH 1/5] gdb: terminate upon receipt of SIGFPE Andrew Burgess
2021-07-02 12:09   ` Eli Zaretskii
2021-07-02 18:11     ` Tom Tromey
2021-07-02 22:51       ` Pedro Alves
2021-07-03  6:14         ` Eli Zaretskii
2021-07-03 18:02           ` Pedro Alves
2021-07-03 18:23             ` Eli Zaretskii
2021-07-03 22:52               ` Pedro Alves
2021-07-04  4:27                 ` Eli Zaretskii
2021-07-04 14:51                   ` Pedro Alves
2021-07-04 16:31                     ` Eli Zaretskii
2021-07-03 22:58   ` Pedro Alves
2021-07-02 11:06 ` [PATCH 2/5] gdb: register signal handler after setting up event token Andrew Burgess
2021-07-03 23:02   ` Pedro Alves
2021-07-02 11:06 ` [PATCH 3/5] gdb: rewrite header comment on async_init_signals Andrew Burgess
2021-07-03 23:23   ` Pedro Alves
2021-07-02 11:06 ` [PATCH 4/5] gdb: print backtrace on fatal SIGSEGV Andrew Burgess
2021-07-02 11:47   ` Eli Zaretskii
2021-07-04  0:55     ` Pedro Alves
2021-07-04  4:32       ` Eli Zaretskii
2021-07-04 14:32         ` Pedro Alves
2021-07-04 14:38           ` Eli Zaretskii
2021-07-04 15:03             ` Pedro Alves [this message]
2021-07-04 16:34               ` Eli Zaretskii
2021-07-04  0:51   ` Pedro Alves
2021-07-04  0:53   ` Pedro Alves
2021-07-02 11:06 ` [PATCH 5/5] gdb: register SIGBUS, SIGFPE, and SIGABRT handlers Andrew Burgess
2021-07-04  0:58   ` Pedro Alves
2021-07-21 18:08 ` [PATCHv2 0/6] GDB Synchronous Signal Handling Andrew Burgess
2021-07-21 18:08   ` [PATCHv2 1/6] gdb: terminate upon receipt of SIGFPE Andrew Burgess
2021-07-21 18:08   ` [PATCHv2 2/6] gdb: register signal handler after setting up event token Andrew Burgess
2021-07-21 18:08   ` [PATCHv2 3/6] gdb: rename async_init_signals to gdb_init_signals Andrew Burgess
2021-07-21 18:08   ` [PATCHv2 4/6] gdb: print backtrace on fatal SIGSEGV Andrew Burgess
2021-08-10 18:53     ` Pedro Alves
2021-07-21 18:08   ` [PATCHv2 5/6] gdb: register SIGBUS, SIGFPE, and SIGABRT handlers Andrew Burgess
2021-07-21 18:08   ` [PATCHv2 6/6] gdb: don't print backtrace when dumping core after an internal error Andrew Burgess
2021-07-27 18:54   ` [PATCHv2 0/6] GDB Synchronous Signal Handling Tom Tromey
2021-08-10  9:33   ` Andrew Burgess
2021-08-10 18:56     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b0aeebb-2fff-35e3-f068-d4967bf1540c@palves.net \
    --to=pedro@palves.net \
    --cc=andrew.burgess@embecosm.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).