[PATCH 0/2] Demangler crash handler

Gary Benson gbenson@redhat.com
Thu May 22 13:18:00 GMT 2014


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



More information about the Gdb-patches mailing list