Skip to content

Conversation

@NicksWorld
Copy link
Contributor

Currently all crashlogs produced on Linux end with a opaque offset within libdfhack.so, which can cause some confusion.

Signal SIGSEGV
0> hack/libdfhack.so(+0x936f90) [0x7b040d336f90]

This PR causes the crashhandler to skip printing the first backtrace entry, which will always be dfhack_crashlog_handle_signal or dfhack_crashlog_handle_terminate, where the backtrace is retrieved. To ensure exactly one crashhandler-related entry is added to the stack frames, handle_signal_internal is marked with [[gnu::always_inline]] to ensure it doesn't create a stack frame.

Alternatively, we can clear up the opaque entry by enabling symbol visibility on dfhack_crashlog_handle_(signal|terminate) by marking them with DFHACK_EXPORT, with the following result:

Signal SIGSEGV
0> hack/libdfhack.so(dfhack_crashlog_handle_signal+0x62) [0x7fffe3955052]

@ab9rf ab9rf merged commit 7f6f80c into DFHack:develop Dec 6, 2025
14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants