public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15573] New: Decode fatal signals to show faulting address, access type, etc.
@ 2013-06-04 18:37 luto at mit dot edu
  2013-06-05  9:08 ` [Bug gdb/15573] " palves at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: luto at mit dot edu @ 2013-06-04 18:37 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15573

            Bug ID: 15573
           Summary: Decode fatal signals to show faulting address, access
                    type, etc.
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: luto at mit dot edu

I have a (buggy) program that segfaulted while running in gdb.  gdb said:

Program received signal SIGSEGV, Segmentation fault.

followed by a stacktrace.  If I weren't using gdb, my program's signal handler
would have run and displayed a far more useful error message:

Caught fatal signal: Segmentation fault (Address not mapped to object [0x28])
Dying due to fatal signal Segmentation fault in pid 14030 / tid 14030
The error was "not mapped" at address 28. The CPU reported page not present
reading from 28.

This is on x86_64.  That information comes from psiginfo (the first line) and a
custom decoder that reads SEGV_MAPERR as "not mapped" and pulls the number 28
from siginfo (the first time) and cr2 (the second time).  The "page not
present" part is the low bit of the error code (from ucontext); the alternative
is "protection violation", which is a different error.  The "reading from" part
is really quite handy when debugging; it distinguishes read faults from write
faults.  The alternatives are "executing from" and "writing to".

Having gdb decode this information would save a lot of time tracking down bugs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-15  4:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-04 18:37 [Bug gdb/15573] New: Decode fatal signals to show faulting address, access type, etc luto at mit dot edu
2013-06-05  9:08 ` [Bug gdb/15573] " palves at redhat dot com
2013-06-05  9:44 ` palves at redhat dot com
2013-06-15  4:44 ` luto at mit dot edu

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).