Skip to content

what if i want to get the othe threads' stack #809

Answered by supervacuus
NikoLXQ asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @NikoLXQ! On which OS are you trying to do this?

The general answer: sentry_value_new_stacktrace() internally uses OS APIs that capture only the stack trace from the calling thread. This is because tracing the stack from another thread is not safe since that thread continues to run. Suspending and resuming threads are typically application-level responsibilities.

In the crash case, our backends use OS-level debug capabilities to suspend all threads before snapshotting their stacks which can have racy consequences because it stops threads in uncoordinated moments. This is considered acceptable when the application is going to crash anyway, but a big issue in normal operation.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NikoLXQ
Comment options

@supervacuus
Comment options

Answer selected by NikoLXQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants