Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use backtrace as a backend for boost-stacktrace #3050

Open
andrewerf opened this issue Jul 23, 2024 · 0 comments
Open

Use backtrace as a backend for boost-stacktrace #3050

andrewerf opened this issue Jul 23, 2024 · 0 comments

Comments

@andrewerf
Copy link
Contributor

Currently, stacktrace on linux does not provide numbers of lines. This is correct default behavior according to boost documentation, which could be modified by a flag: BOOST_STACKTRACE_USE_BACKTRACE.

However, I have experienced some issues when trying to introduce this flag in MeshLib (#3036). Namely, it works only if compiled twice.

Steps to reproduce

  1. Build ubuntu22 container from the docker folder
  2. Inside the container, run
git clone --recursive https://github.com/MeshInspector/MeshLib.git
cd MeshLib
git switch boost-use-backtrace
ln -s /usr/local/lib/meshlib-thirdparty-lib/include ./include
ln -s /usr/local/lib/meshlib-thirdparty-lib/lib ./lib
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j12
  1. The branch asserts on application start-up, therefore a stacktrace is printed. This build, however, does not produce line numbers. The application can be started with the following commad: ./bin/MeshViewer.
  2. Then, run the following command: cmake .. -DCMAKE_BUILD_TYPE=Debug -DMESHINSPECTOR_CUDA_SUPPORT=OFF && make -j12 (the important part is to change configuration somehow, the problem does not seem to be related to cuda specifically and the similar result could be achieved by modifying sources).
  3. This time, if started, the application produces a stacktrace with line numbers.
  4. We can do the same thing in reverse: first time compile with MESHINSPECTOR_CUDA_SUPPORT=OFF and second time without this flag, and the result will be equivalent: first-time build does not print line numbers, and second-time build does.

Thoughts

I failed to produce a MRE. Simple programs with backtrace and boost_backtrace work as expected. I think the problem is somehow related to PCH, but have not yet justified this claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant