Closed raccog closed 2 years ago
When running the simple program below, saved as test.cpp;
test.cpp
#include <iostream> #define BOOST_STACKTRACE_USE_ADDR2LINE #include <boost/stacktrace.hpp> int main() { std::cout << boost::stacktrace::stacktrace(); }
the output is:
0# main at /usr/include/boost/stacktrace/stacktrace.hpp:129 1# __libc_start_main in /usr/lib/libc.so.6 2# _start in ./a.out
The first frame lists the wrong source file and line position. This output should be:
0# main at /<SOURCE_DIRECTORY>/test.cpp:6 1# __libc_start_main in /usr/lib/libc.so.6 2# _start in ./a.out
where <SOURCE_DIRECTORY> is the directory containing the test.cpp source file.
<SOURCE_DIRECTORY>
g++ -g -no-pie -fno-pie -rdynamic -ldl -lboost_stacktrace_addr2line test.cpp
OS: Linux 5.16.3 Boost Version: 1.78.0 Compiler: gcc 11.1.0
After some further digging, I have found out that this problem originates from GNU addr2line. So I am marking this issue as closed.
Description
When running the simple program below, saved as
test.cpp
;the output is:
The first frame lists the wrong source file and line position. This output should be:
where
<SOURCE_DIRECTORY>
is the directory containing thetest.cpp
source file.Steps to Reproduce
System
OS: Linux 5.16.3 Boost Version: 1.78.0 Compiler: gcc 11.1.0
Questions