Bug 24403 - addr2line _GLOBAL__sub_I__Z11print_tracev
Summary: addr2line _GLOBAL__sub_I__Z11print_tracev
Status: RESOLVED MOVED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-31 10:15 UTC by Jonny Grant
Modified: 2019-04-10 16:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
test case (803 bytes, text/x-c++src)
2019-03-31 10:15 UTC, Jonny Grant
Details
compiled file (35.87 KB, application/x-sharedlib)
2019-03-31 10:15 UTC, Jonny Grant
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonny Grant 2019-03-31 10:15:01 UTC
Created attachment 11712 [details]
test case

The attached test case, when compiled and run shows a symbol which isn't demangled by addr2line. I'll attach the file, and the compiled file

_GLOBAL__sub_I__Z11print_tracev

The output below shows it as item [2].

It is the same as running manually addr2line

$ addr2line -f -C -e exception4 0x0000000000001600
_GLOBAL__sub_I__Z11print_tracev
/home/jonny/code/crash/exception4.cpp:100




$ g++-8 -g -pipe -pthread -O1 -o exception4 exception4.cpp
jonny@asus:~/code/crash$ ./exception4
Unhandled C++ exception: [vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)]

Backtrace:
[1]: ./exception4(+0x15c9) [0x56129dea75c9]
0x00000000000015c9
test()
exception4.cpp:85
[2]: ./exception4(+0x1600) [0x56129dea7600]
0x0000000000001600
_GLOBAL__sub_I__Z11print_tracev
exception4.cpp:100
[3]: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fc0f8dd1b97]
0x0000000000000000
??
??:0
[4]: ./exception4(+0x10da) [0x56129dea70da]
0x00000000000010da
_start
??:?
Aborted
Comment 1 Jonny Grant 2019-03-31 10:15:25 UTC
Created attachment 11713 [details]
compiled file
Comment 2 Jonny Grant 2019-03-31 12:33:58 UTC
Looks like it is just the "_GLOBAL__sub_I_" prefix which isn't recognised.


$ c++filt _GLOBAL__sub_I__Z11print_tracev
_GLOBAL__sub_I__Z11print_tracev
$
$ c++filt _Z11print_tracev
print_trace()
$
$ c++filt --version
GNU c++filt (GNU Binutils for Ubuntu) 2.30


Would be good if c++filt could also decode the symbol.
Comment 3 Nick Clifton 2019-04-10 16:17:15 UTC
(In reply to Jonny Grant from comment #2)
Hi Jonny,

> Looks like it is just the "_GLOBAL__sub_I_" prefix which isn't recognised.
> Would be good if c++filt could also decode the symbol.

Actually the code that needs to be updated is the libiberty
library, which contains the name demangling code.  (A quick
look shows that it already has code to detect a __GLOBAL_
prefix, so there is precedence for this kind of thing).

Unfortunately the libiberty library is maintained as part of
the gcc project, not the binutils project.  (It is used by
the binutils in c++filt amongst other tools, but it is not
maintained by us).  So please could you refile this PR as
an enhancement request with gcc ?

Cheers
  Nick
Comment 4 Jonny Grant 2019-04-10 16:57:18 UTC
Hi Nick
Thank you for pinpointing the library.

ok I filed with gcc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90039

Cheers, Jonny