Bug 191365 - Name demangling doesn't work for local names
Summary: Name demangling doesn't work for local names
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 9.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-25 13:38 UTC by Ivan Kosarev
Modified: 2017-04-24 13:30 UTC (History)
1 user (show)

See Also:


Attachments
The test source (563 bytes, text/plain)
2014-06-25 13:38 UTC, Ivan Kosarev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Kosarev 2014-06-25 13:38:20 UTC
The C++ ABI's __cxa_demangle() function rejects unscoped/local/static names.

The attached test outputs:

_Z9NullDerefPi: status 0; demangled: 'NullDeref(int*)'
_ZL9NullDerefPi: status -2

The expected output is:

_Z9NullDerefPi: status 0; demangled: 'NullDeref(int*)'
_ZL9NullDerefPi: status 0; demangled: 'NullDeref(int*)'

Obvisouly, the reason of the rejection is the 'L' in front of the 2nd identifier. That letter reflects the fact the name is declared static:

static void NullDeref(int*);

This defect prevents the LLVM's address sanitizer test null_deref.cc from passing on FreeBSD 9.2 .
Comment 1 Ivan Kosarev 2014-06-25 13:38:58 UTC
Created attachment 144120 [details]
The test source
Comment 2 Ed Maste freebsd_committer freebsd_triage 2015-05-05 17:02:52 UTC
__cxa_demangle on 10.1+ / HEAD handles these. No more releases are planned from stable/9.
Comment 3 Ed Maste freebsd_committer freebsd_triage 2017-04-24 13:30:35 UTC
Thank you for the report. FreeBSD 9 is now past its end of life date. I have verified that this issue is not present in FreeBSD 10 and later.