sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

Missing panic line when running app in release mode

Open gdesmott opened this issue 1 year ago • 0 comments
trafficstars

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.

gdesmott avatar Oct 03 '24 09:10 gdesmott