Repository navigation
Conversation
sentry-native resolves its out-of-process crash handler next to the running executable unless handler_path is set, and the bridge never set it. Add SentryUnityOptions.NativeHandlerPath and pass it through, using the wide variant on Windows the way database_path already does.
bitsandfoxes
requested changes
Sep 18, 2026
bitsandfoxes
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution! Other than those two minor tweaks this looks like it's good to go!
| #if !SENTRY_NATIVE_SWITCH | ||
| // Left unset, sentry-native looks for the handler next to the running executable. | ||
| // Switch does not run an out-of-process handler, so the option does not apply there. | ||
| if (options.NativeHandlerPath is not null) |
Contributor
There was a problem hiding this comment.
Suggested change
| if (options.NativeHandlerPath is not null) | |
| if (!string.IsNullOrWhiteSpace(options.NativeHandlerPath)) |
Ideally, we'd actually check for the file to be there. But that would require a change to the underlying submodule so it's fine for now.
Co-authored-by: Stefan Jandl <reg@bitfox.at>
Contributor
|
Thanks a lot for the contribution and the detailed write-up, @mollstam! Since the branch doesn't allow maintainer edits and needed a rebase plus a couple of fixes ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sentry-unity never calls
sentry_options_set_handler_path, so sentry-native falls back to looking forcrashpad_handler.exenext to the game executable.Player use eg MelonLoader to load mods into the game, it hooks by placing itself as
version.dllin game root directory which causes the Unity runtime to load it on launch (it's looking forversion.dllin the Windows system dir but local copy takes precedence). This is naturally risky code and may crash the game, at which point the Sentry crashpad triggers. Ifcrashpad_handler.exeis in the game root directory (which it currently has to be) it will also load the injectedversion.dllinto the handler itself. It causes crashpad to crash leaving the process suspended and no crash report delivered.Binding
handler_pathlets the handler be staged outside the game root. Moving ours to<Game>_Data/Plugins/x86_64/restored native crash capture on modded installs.Not sure about the changelog additions etc, let me know if you need anything changed. 🙇🏻