feat: in proc App Hang capture#1806
Conversation
|
…entry-native into feat/app-hang-inproc
There was a problem hiding this comment.
Great stuff! This was a good read - learned a lot of new things about sentry-native. Surprisingly concise PR for what it does. Got my brain cooked trying to understand the nuances between the various unwinder implementations 😅 You may want to have others take a look too, esp someone who knows unwinders well.
Let's try integrating this into Godot. In the context of the Godot SDK, Godot Engine doesn't provide an API for inspecting script stack traces from other threads, so this would only be of use for issues triggered in the native code (engine or C++ extension). Now I'm wondering what would be required to make script traces possible for App Hangs. And same for CoreCLR .NET.
tustanivsky
left a comment
There was a problem hiding this comment.
LGTM - tested this in Unreal on Windows, Linux and macOS (getsentry/sentry-unreal#1427) and it works as expected. I also confirmed that in-process hang tracking allows us to bypass the IPC limitations in sandboxed Mac applications.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 88e1e73. Configure here.

Resolves https://github.com/getsentry/team-gdx/issues/155
Alternative or parallelization of #1780
The Goal
The goal is to have a mechanism that allows capture of frozen/stuck main threads. The resulting event should provide the same level of detail and insights as actual errors. This means contexts, tags, breadcrumbs, trace, and stack trace.
The How
With an in-proc thread stackwalker, we pause (lol) the hung thread, get to the stack, and create a proper event.
Whatever is considered the main thread periodically calls
heartbeaton the SDK. This reset a timestamp. The monitor captures the state of the stuck process should the timestamp exceed the configured threshold.For this the PR adds the following new API:
sentry_options_set_app_hang_enabled:sentry_options_set_app_hang_timeout_mssentry_app_hang_heartbeatLimitations & Followups:
The Result
macOS
Windows