public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Demangler crash handler
@ 2014-05-09 10:07 Gary Benson
  2014-05-09 10:09 ` [PATCH 1/2] " Gary Benson
                   ` (2 more replies)
  0 siblings, 3 replies; 50+ messages in thread
From: Gary Benson @ 2014-05-09 10:07 UTC (permalink / raw)
  To: gdb-patches

Hi all,

A number of bugs have been filed recently because of segmentation
faults in the demangler.  While such crashes are a problem for all
demangler consumers, they are particularly nasty for GDB because they
prevent the user from debugging their program at all.

This patch series arranges for GDB to catch segmentation faults in the
demangler and recover from them gracefully.  A warning is printed the
first time a fault occurs.  Example sessions with and without these
patches are included below.

None of the wrapped code uses cleanups, so each caught failure will
leak a small amount of memory.  This is undesirable but I think the
benefits here outweigh this drawback.

Ok to commit?

Thanks,
Gary

-- 
http://gbenson.net/


The current situation:

  GNU gdb (GDB) 7.7.50.20140507-cvs
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-unknown-linux-gnu".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  <http://www.gnu.org/software/gdb/bugs/>.
  Find the GDB manual and other documentation resources online at:
  <http://www.gnu.org/software/gdb/documentation/>.
  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  (gdb) file test
  Reading symbols from test...Segmentation fault (core dumped)

With these patches:

  GNU gdb (GDB) 7.7.50.20140508-cvs
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-unknown-linux-gnu".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  <http://www.gnu.org/software/gdb/bugs/>.
  Find the GDB manual and other documentation resources online at:
  <http://www.gnu.org/software/gdb/documentation/>.
  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  (gdb) file test
  Reading symbols from test...
  warning: internal error: demangler failed with signal 11
  Unable to demangle '_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z'
  This is a bug, please report it to the GDB maintainers.
  done.
  (gdb) b puts
  Breakpoint 1 at 0x400488
  (gdb) r
  Starting program: /home/gary/work/archer/demangle-crashcatcher/src/test
  warning: Skipping deprecated .gdb_index section in /usr/lib/debug/lib64/ld-2.12.so.debug.
  Do "set use-deprecated-index-sections on" before the file is read
  to use the section anyway.

  Breakpoint 1, _IO_puts (str=0x4006d8 "hello") at ioputs.c:35
  35	{
  (gdb) bt
  #0  _IO_puts (str=0x4006d8 "hello") at ioputs.c:35
  #1  0x00000000004005b2 in hello () at test.cc:6
  #2  0x00000000004005bd in _QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z () at test.cc:12
  #3  0x00000000004005d3 in main (argc=1, argv=0x7fffffffe618) at test.cc:18

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

end of thread, other threads:[~2014-05-22 20:42 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-09 10:07 [PATCH 0/2] Demangler crash handler Gary Benson
2014-05-09 10:09 ` [PATCH 1/2] " Gary Benson
2014-05-09 10:10 ` [PATCH 2/2] " Gary Benson
2014-05-09 11:20 ` [PATCH 0/2] " Mark Kettenis
2014-05-09 15:33   ` Gary Benson
2014-05-11  5:17     ` Doug Evans
2014-05-13 10:20       ` Gary Benson
2014-05-13 19:29         ` Tom Tromey
2014-05-14 13:07           ` Gary Benson
2014-05-13 19:39         ` Tom Tromey
2014-05-14  9:15           ` Gary Benson
2014-05-11 20:23     ` Mark Kettenis
2014-05-13 10:21       ` Gary Benson
2014-05-13 16:05         ` Pedro Alves
2014-05-15 13:24           ` Gary Benson
2014-05-15 14:07             ` Pedro Alves
2014-05-15 14:28               ` Gary Benson
2014-05-15 15:25                 ` Pedro Alves
2014-05-16 11:06             ` Pedro Alves
2014-05-10 20:55   ` Florian Weimer
2014-05-11  5:10     ` Doug Evans
2014-05-13 10:22     ` Gary Benson
2014-05-13 18:22       ` Florian Weimer
2014-05-13 18:42         ` Pedro Alves
2014-05-13 19:16           ` Gary Benson
2014-05-13 19:19             ` Pedro Alves
2014-05-14  9:11               ` Gary Benson
2014-05-13 19:20           ` Florian Weimer
2014-05-13 19:22             ` Pedro Alves
2014-05-13 19:22         ` Gary Benson
2014-05-13 19:36           ` Tom Tromey
2014-05-14  9:13             ` Gary Benson
2014-05-14 14:18     ` Pedro Alves
2014-05-14 16:08       ` Andrew Burgess
2014-05-14 18:32         ` Pedro Alves
2014-05-15 13:25           ` Gary Benson
2014-05-15 16:01             ` Pedro Alves
2014-05-15 13:27       ` Gary Benson
2014-05-20 17:05       ` Tom Tromey
2014-05-20 18:40         ` Stan Shebs
2014-05-20 19:36           ` Tom Tromey
2014-05-20 20:23             ` Joel Brobecker
2014-05-22 12:56               ` Gary Benson
2014-05-22 13:09                 ` Joel Brobecker
2014-05-22 14:13                 ` Pedro Alves
2014-05-22 15:57                   ` Gary Benson
2014-05-22 13:18           ` Gary Benson
2014-05-22 14:09         ` Gary Benson
2014-05-22 14:40           ` Mark Kettenis
2014-05-22 20:42             ` Gary Benson

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