Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 613250 - sys-devel/gcc (at least 5.4 and 6.3) can produce undemangable symbols that crash gdb
Summary: sys-devel/gcc (at least 5.4 and 6.3) can produce undemangable symbols that cr...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-19 19:07 UTC by pa.lacaze
Modified: 2019-08-03 02:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
testcase (test-undemangable.cpp,1.55 KB, text/x-c++src)
2017-03-19 19:07 UTC, pa.lacaze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pa.lacaze 2017-03-19 19:07:36 UTC
Created attachment 467596 [details]
testcase

Not sure if this is the right place for this bug report, I can't fill one on gcc's one because it is access-restricted.

The attached test case compiles just fine with g++ 5.4, g++ 6.3 and clang 3.9 but embeds an invalid symbol name, "_ZSt7forwardIRZ4mainEUlRT_E_EOS0_RNSt16remove_referenceIS0_E4typeE", that nor c++-filt nor gdb can de demangle when compiled with GCC. Clang does not reproduce the issue.

steps to reproduce:
g++ -std=c++14 test-undemanglable.cpp
gdb ./a.out   # gdb core dump
strings a.out | c++-filt # c++-filt segmentation error

This is an issue because it makes gdb unusable if not used stand-alone (it is able to recover from it).
Comment 1 pa.lacaze 2017-06-12 16:45:35 UTC
Small update to notify it stills happen with Gcc 7.1
Comment 2 pa.lacaze 2017-06-12 16:58:24 UTC
Oh, and I forgot to mention that I only happens with an optimisation level of 0, and seems to be related to generic lambdas.

The good news is that it does not seem to be gentoo specific, I can reproduce it on godbolt: https://godbolt.org/g/s94Ii6 (line 232 in assembly output).
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-27 11:57:50 UTC
Does it still happen o gcc-7?

At least c++filt does something sensible for me:

$ c++filt _ZSt7forwardIRZ4mainEUlRT_E_EOS0_RNSt16remove_referenceIS0_E4typeE
main::{lambda(auto:1&)#1}& std::forward<main::{lambda(auto:1&)#1}&>(std::remove_reference<main::{lambda(auto:1&)#1}&>::type&)