Bug 191365

Summary: Name demangling doesn't work for local names
Product: Base System Reporter: Ivan Kosarev <ivan>
Component: standardsAssignee: Ed Maste <emaste>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: emaste
Priority: ---    
Version: 9.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
The test source none

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.