llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

llvm-symbolize can't demangle some function in libc++

Open KernelAddress opened this issue 11 years ago • 5 comments

Bugzilla Link 23292
Resolution FIXED
Resolved on Jul 14, 2017 12:57
Version unspecified
OS Linux
CC @KernelAddress,@kcc,@mclow,@rnk

Extended Description

clang version 3.7.0 (trunk 235290) Target: x86_64-unknown-linux-gnu

Testing reproducer from https://llvm.org/bugs/show_bug.cgi?id=23235 with tsan-ified libc++ I got the following output:

#​0 _ZNSt3__18__invokeIMNS_19__async_assoc_stateIbNS_12__async_funcIZ4mainE3$_0JEEEEEFvvEPS5_JEvEEDTcldsdeclsr3std3__1E7forwardIT0_Efp0_Efp_spclsr3std3__1E7forwardIT1_Efp1_EEEOT_OS9_DpOSA_ include/c++/v1/__functional_base:382:43 (a.out+0x000000499458)

The function is not demangled while all other function are demangled. This looks like a bug in demangler.

KernelAddress avatar Apr 20 '15 11:04 KernelAddress

Works fine with TOT llvm-cxxfilt, must have been fixed.

llvmbot avatar Jul 14 '17 19:07 llvmbot

google-glog has a demangler.

https://github.com/google/glog

llvmbot avatar Jul 05 '15 09:07 llvmbot

We've been talking about putting a demangler in LLVM so tools like lld and llvm-symbolizer don't have to rely on the (possibly out of date) platform demangler. However, the libcxxabi implementation of __cxa_demangle is apparently a disaster, and nobody wants to write a new one. :(

rnk avatar Apr 20 '15 22:04 rnk

We declare function as extern "C" __cxa_demangle() and use whatever function is actually available in the executable (it can come from demangler in libc++abi, or from libsupc++).

llvmbot avatar Apr 20 '15 21:04 llvmbot

Alexey, what function do we use for demangling in llvm-symbolizer by default? Is it __cxxabiv1::__cxa_demangle?

KernelAddress avatar Apr 20 '15 11:04 KernelAddress