public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/112263] New: [C++23] std::stacktrace does not identify symbols in shared library Date: Sat, 28 Oct 2023 15:35:54 +0000 [thread overview] Message-ID: <bug-112263-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112263 Bug ID: 112263 Summary: [C++23] std::stacktrace does not identify symbols in shared library Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: vincenzo.innocente at cern dot ch Target Milestone: --- using gcc version 14.0.0 20231028 (experimental) [master r14-4988-g5d2a360f0a5] (GCC) that contains the fix for #111936 This simple example [1] when run as a single executable prints all symbols in the stacktrace when the nested functions are in a shared library their names are missing c++ -std=c++23 testStacktrace.cpp -lstdc++exp -g -DINMAIN -DINLIB ; ./a.out 0# nested_func2(int) at /afs/cern.ch/user/i/innocent/public/ctest/testStacktrace.cpp:13 1# nested_func(int) at /afs/cern.ch/user/i/innocent/public/ctest/testStacktrace.cpp:18 2# func(int) at /afs/cern.ch/user/i/innocent/public/ctest/testStacktrace.cpp:26 3# main at /afs/cern.ch/user/i/innocent/public/ctest/testStacktrace.cpp:31 4# at :0 5# _start at :0 6# c++ -std=c++23 testStacktrace.cpp -lstdc++exp -g -DINLIB -fpic -shared -o liba.so ; c++ -std=c++23 testStacktrace.cpp -lstdc++exp -g -DINMAIN -L. -la -Wl,-rpath=. ; ./a.out 0# at :0 1# at :0 2# func(int) at /afs/cern.ch/user/i/innocent/public/ctest/testStacktrace.cpp:26 3# main at /afs/cern.ch/user/i/innocent/public/ctest/testStacktrace.cpp:31 4# at :0 5# _start at :0 6# [1] cat testStacktrace.cpp //compile and run with either // c++ -std=c++23 testStacktrace.cpp -lstdc++exp -g -DINMAIN -DINLIB; ./a.out // or // c++ -std=c++23 testStacktrace.cpp -lstdc++exp -g -DINLIB -fpic -shared -o liba.so;c++ -std=c++23 testStacktrace.cpp -lstdc++exp -g -DINMAIN -L. -la -Wl,-rpath=.; ./a.out // #include <iostream> #include <stacktrace> #ifdef INLIB int nested_func2(int c) { std::cout << std::stacktrace::current() << '\n'; return c + 1; } int nested_func(int c) { return nested_func2(c + 1); } #else int nested_func(int c); #endif #ifdef INMAIN int func(int b) { return nested_func(b + 1); } int main() { std::cout << func(777); return 0; } #endif
next reply other threads:[~2023-10-28 15:35 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-28 15:35 vincenzo.innocente at cern dot ch [this message] 2023-10-28 21:04 ` [Bug libstdc++/112263] " redi at gcc dot gnu.org 2023-10-30 13:43 ` [Bug libbacktrace/112263] " vincenzo.innocente at cern dot ch 2023-10-31 1:07 ` ian at airs dot com 2023-10-31 10:45 ` vincenzo.innocente at cern dot ch 2023-11-01 11:16 ` vincenzo.innocente at cern dot ch 2023-11-01 13:09 ` vincenzo.innocente at cern dot ch 2023-11-03 3:05 ` ian at airs dot com 2023-11-03 9:55 ` vincenzo.innocente at cern dot ch 2023-11-03 16:32 ` redi at gcc dot gnu.org 2023-11-04 5:56 ` pinskia at gcc dot gnu.org 2023-11-05 0:05 ` ian at airs dot com 2023-11-05 10:49 ` vincenzo.innocente at cern dot ch 2023-11-06 23:11 ` cvs-commit at gcc dot gnu.org 2023-11-06 23:12 ` cvs-commit at gcc dot gnu.org 2023-11-06 23:13 ` cvs-commit at gcc dot gnu.org 2023-11-06 23:13 ` ian at airs dot com 2023-11-06 23:30 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-112263-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).