This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/2] Demangler crash handler
- From: Gary Benson <gbenson at redhat dot com>
- To: Stan Shebs <stanshebs at earthlink dot net>
- Cc: Florian Weimer <fw at deneb dot enyo dot de>, Mark Kettenis <mark dot kettenis at xs4all dot nl>, Pedro Alves <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 22 May 2014 14:17:56 +0100
- Subject: Re: [PATCH 0/2] Demangler crash handler
- Authentication-results: sourceware.org; auth=none
- References: <20140509100656 dot GA4760 at blade dot nx> <201405091120 dot s49BKO1f010622 at glazunov dot sibelius dot xs4all dot nl> <87fvkhjqvs dot fsf at mid dot deneb dot enyo dot de> <53737737 dot 2030901 at redhat dot com> <87ppj8s7my dot fsf at fleche dot redhat dot com> <537BA194 dot 904 at earthlink dot net>
Stan Shebs wrote:
> My memory may be playing tricks on me, but once upon a time it
> seemed like the demangler was the most reliable part of the mixed
> bag that was C++ debugging - segfaults were pretty much unheard of.
> So it's a little strange to me that it's now become so troublesome
> that it needs to be wrapped, or has been suggested, to be run in a
> different process(!), and it reinforces Mark K's original point
> about signal catchers masking more serious problems.
Apart from the ones the fuzzer found, the recent crashes [1] all seem
to have C++11 features, specifically, lambdas or lvalue references or
both. My suspicion is that these bugs are being shaken out as C++11
code becomes more widespread and/or people are doing more complicated
things with it.
> Complicated or not, the demangler is one of the most algorithmically
> predictable components of GDB, and it is very easy to test
> comprehensively; no races, no arcane target dependencies, textual
> input and output.
For sure, but somebody needs to write those tests, and that somebody
needs 1) a deep knowledge of C++, including C++11, 2) a deep knowledge
of the mangling scheme, and 3) the time and inclination to sit down
and compile an extensive test suite. I don't know anybody with three
out of three.
Thanks,
Gary
--
[1] https://github.com/gbenson/binutils-gdb/blob/demangler/segfault-test.tests