We use libelftc for demangling in the DynamoRIO project and recently I updated to a newer version and hit an assertion in our demangling test:
libelftc_dem_gnu3.c:2138: cpp_demangle_read_sname: Assertion `ddata->output.size > 0' failed.
That fires when demangling this symbol:
_ZZN7WebCore19SVGAnimatedProperty20LookupOrCreateHelperINS_32SVGAnimatedStaticPropertyTearOffIbEEbLb1EE21lookupOrCreateWrapperEPNS_10SVGElementEPKNS_15SVGPropertyInfoERbE19__PRETTY_FUNCTION__
You should be able to readily reproduce by demangling that symbol.
I tracked the assert down to r3531. r3531 also fixes a symbol that previously failed:
_ZN10linked_ptrIN12CrxInstaller14WhitelistEntryEE4copyIS1_EEvPKS_IT_E
But that was a graceful failure. This new assert indicates memory bugs and memory corruption.
FYI, our test demangles a series of symbols here:
https://github.com/DynamoRIO/dynamorio/blob/master/suite/tests/client-interface/drsyms-test.dll.cpp#L944
See also https://github.com/DynamoRIO/dynamorio/issues/4087#issuecomment-586031998.
I see this problem at FreeBSD-11.3
Problem name is
_ZZN5boost13serialization16singleton_module8get_lockEvE4lockHere's a three part fix set for the problems described above.
ticket581-1.diff:
This fixes the "ddata->output.size > 0" assertion which occurs right when the demangling starts.
ticket581-2.diff:
This fixes the next assertion you get, when demangling a name with nested template arguments (such as in the WebCore example above).
ticket582-3.diff:
This fixes yet another assertion, when the first fixes have been applied.
Added in [r3877], thanks!
Related
Commit: [r3877]
See also: ticket [#554].
Related
Tickets: #554
Last edit: Joseph Koshy 2020-11-04