Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling std::abort() yields unusable stacktrace in Windows 10 Release builds #1126

Open
1 of 3 tasks
hugoam opened this issue Jan 24, 2025 · 0 comments
Open
1 of 3 tasks

Comments

@hugoam
Copy link

hugoam commented Jan 24, 2025

Description

Calling std::abort() yields unusable stacktrace in Windows 10 Release builds

When does the problem happen

  • During build
  • During run-time
  • When capturing a hard crash

Environment

  • OS: Windows 10, 64-bit
  • Compiler: MSVC 19
  • Sentry-native version: 0.7.16
  • MSVC Runtime Library: /MD
  • MSVC Debug Info: /DEBUG
  • MSVC Optimization Level: /O2 + /Ob2

Steps To Reproduce

    sentry_options_t *options = sentry_options_new();
    sentry_options_set_dsn(options, /* ... */);
    sentry_options_set_release(options, /* ... */);
    sentry_options_set_debug(options, 1);
    sentry_init(options);

    std::abort();

When run in Release build, this code yields a mostly unusable and seemingly incorrect stack trace:
Image

The same code with throw std::runtime_error("abort") instead of std::abort() yields a usable stack trace:
Image

In Debug build, both types of errors yield a usable stack trace

Our Runtime Library flag is /MD in the Release build and /MDd in Debug build

Log output

[sentry] INFO using database path "D:\dev\wdland2\build-release\Release\.sentry-native"
[sentry] DEBUG starting transport
[sentry] DEBUG starting background worker thread
[sentry] DEBUG starting backend
[sentry] DEBUG background worker thread started
[sentry] DEBUG starting crashpad backend with handler "D:\dev\wdland2\build-release\Release\crashpad_handler.exe"
[sentry] DEBUG using minidump URL "[...]"
[sentry] WARN crashpad WER handler module not found
[sentry] INFO started crashpad client handler
[sentry] DEBUG processing and pruning old runs
[sentry] DEBUG sending envelope
[sentry] DEBUG submitting task to background worker thread
[sentry] DEBUG executing task on worker thread
[sentry] DEBUG sending request using winhttp to "[...]"
x-sentry-auth:Sentry sentry_key=[...] sentry_version=7, sentry_client=sentry.native/0.7.16
content-type:application/x-sentry-envelope
content-length:0

[sentry] INFO flushing session and queue before crashpad handler
[sentry] DEBUG sending envelope
[sentry] DEBUG dumped 1 in-flight envelopes to disk
[sentry] INFO handing control over to crashpad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: Needs Discussion
Development

No branches or pull requests

1 participant