Skip to content

fix(native): Resolve the WER module relative to handler_path - #2073

Merged
tustanivsky merged 2 commits into
masterfrom
fix/wer-module-handler-path
Sep 7, 2026
Merged

fix(native): Resolve the WER module relative to handler_path#2073
tustanivsky merged 2 commits into
masterfrom
fix/wer-module-handler-path

Conversation

@tustanivsky

Copy link
Copy Markdown
Collaborator

The native backend looks for sentry-wer.dll only next to the running executable. The crashpad backend resolves crashpad_wer.dll against handler_path instead, so an embedder that installs the handler elsewhere gets a working WER module on crashpad and a silent "Native WER module not found" on native.

In Unreal Engine plugin runtime dependencies are staged under the plugin's own Binaries directory, never next to the game executable:

Game/Binaries/Win64/Game.exe                        <- searched
Game/Plugins/sentry/Binaries/Win64/sentry-crash.exe <- handler_path
Game/Plugins/sentry/Binaries/Win64/sentry-wer.dll   <- ships with the handler

Since plugin doesn't place the DLL next to the executable WER-delivered crashes (__fastfail, heap corruption, stack buffer overrun) are lost on every native-backend build.

wer_module_path() now tries handler_path's directory first and falls back to the executable directory, matching crashpad. Existence checking moves into wer_path_in_dir() so the fallback is actually reached when the handler directory holds no module.

Related items:

The native backend looked for sentry-wer.dll only next to the running
executable, while the crashpad backend resolves crashpad_wer.dll against
handler_path. An embedder that installs the handler in another directory
therefore got a working WER module on crashpad and a silent "Native WER
module not found" on native.

Prefer handler_path's directory and fall back to the executable directory,
so existing layouts keep working. Move the existence check into a helper so
the fallback is reached when the handler directory holds no module.
@tustanivsky
tustanivsky marked this pull request as ready for review September 7, 2026 07:41
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.31%. Comparing base (394af78) to head (35d08c2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2073      +/-   ##
==========================================
- Coverage   74.41%   74.31%   -0.11%     
==========================================
  Files         103      103              
  Lines       26746    26761      +15     
  Branches     4873     4878       +5     
==========================================
- Hits        19903    19887      -16     
- Misses       5487     5527      +40     
+ Partials     1356     1347       -9     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi jpnurmi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tustanivsky
tustanivsky merged commit 5460803 into master Sep 7, 2026
72 checks passed
@tustanivsky
tustanivsky deleted the fix/wer-module-handler-path branch September 7, 2026 08:41
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