Bug 61805 - Demangler crash (GDB PR 17157)
Summary: Demangler crash (GDB PR 17157)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: demangler (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-15 08:38 UTC by Gary Benson
Modified: 2017-03-09 08:50 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Benson 2014-07-15 08:38:21 UTC
The demangler crashes when given this symbol:

_ZNK5niven5ColorIfLi4EEdvIfEENSt9enable_ifIXsrSt13is_arithmeticIT_E5valueEKNS0_IDTmlcvS5__Ecvf_EELi4EEEE4typeES5_

See https://sourceware.org/bugzilla/show_bug.cgi?id=17157
Comment 1 gcc-bugzilla 2015-02-08 20:08:05 UTC
Some more comments, copied from the GDB bug report:

Ok, this problem is a bit more complicated. First, a newer GCC (4.9.1) and Clang 3.5 doesn't produce the symbol any more. Running a more recent c++filt on it now crashes c++filt -- if you look closely, the originally demangled type was also incorrect, as: decltype (((float)()*(float)())) does not make sense -- should have been decltype (float ()*float ()) which is simply float.

I'm debugging a new crash now where the demangler/libiberty starts producing a symbol name with decltype in it, which I strongly suspect is similar to the original issue. Am I right to assume that decltype is never part of a mangled symbol name?
Comment 2 Mark Wielaard 2016-12-04 22:38:48 UTC
GNU c++filt (GNU Binutils) 2.27.51.20161118 doesn't crash and demangles it to:

std::enable_if<std::is_arithmetic<float>::value, niven::Color<decltype (((float)())*((float)())), 4> const>::type niven::Color<float, 4>::operator/<float>(float) const
Comment 3 Markus Trippelsdorf 2017-03-09 08:50:58 UTC
fixed