public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/112263] New: [C++23] std::stacktrace does not identify symbols in shared library
@ 2023-10-28 15:35 vincenzo.innocente at cern dot ch
  2023-10-28 21:04 ` [Bug libstdc++/112263] " redi at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2023-10-28 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-11-06 23:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-28 15:35 [Bug libstdc++/112263] New: [C++23] std::stacktrace does not identify symbols in shared library vincenzo.innocente at cern dot ch
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

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).