getsentry / sentry-rust

Official Sentry SDK for Rust
https://sentry.io/
Apache License 2.0
620 stars 153 forks source link

Missing panic line when running app in release mode #693

Open gdesmott opened 1 month ago

gdesmott commented 1 month ago

Environment

Using crate sentry 0.34.0

Steps to Reproduce

Run the following test app in release mode.

fn main() {
    let _guard = sentry::init(("XXX", sentry::ClientOptions {
    release: sentry::release_name!(),
    ..Default::default()
  }));

    let a = None::<bool>;
    #[allow(clippy::unnecessary_literal_unwrap)]
    a.unwrap();
}

Expected Result

The app crashes and provides the line with the failing assertion:

thread 'main' panicked at src/bin/sentry.rs:9:7:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This line should be part of the sentry crash report.

Actual Result

Unfortunately the line is missing from the report:

Image

Note that it works fine when running in debug mode:

Image

At the very least the release report should have the line where the assertion failed as it's part of the crash output.