How to create useful backtrace on Linux
When working on Linux, it can sometimes happen that BricsCAD suddenly crashes and disappears.
When running BricsCAD from Terminal, a short error message is printed (often it will be "Segmentation fault"), but this does not provide helpful information about why the crash happens.
In this case, a backtrace (stack trace) becomes very useful for the technical support team to identify the cause of the crash. It shows the current stack of nested function calls at the moment of the crash.
BricsCAD crashes without useful information about the crash.
- In a Terminal instance, run BricsCAD inside gdb with the following command:
LD_LIBRARY_PATH=/opt/bricsys/bricscad/vXX GDK_BACKEND=x11 QT_QPA_PLATFORM=xcb gdb
/opt/bricsys/bricscad/vXX/bricscadNote: vXX will be replaced with the major BricsCAD version number, for example V23.
- In the window, type run and press Enter to start the program.
- Reproduce the crash. After crashing, the BricsCAD window simply freezes, but it does not disappear.
- Switch back to the Terminal, type bt and press Enter to get a backtrace.
If bt does not work, it means BricsCAD might be hanging rather than crashing. In that case, press CTRL+C to pause BricsCAD, then bt should work.The complete backtrace might not fit the screen. In that case, the last line reads like this:
---Type < return > to continue, or q < return > to quit---
- Copy the relevant part of the backtrace into a text editor and attach it to a support request, or post it directly into the support request.
- Type q and press Enter into the Terminal window.
- Type y and press Enter to confirm.