You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
Describe the bug
If Options::set_before_send is used, and a native crash occurs, sentry fails to serialize the envelope contain the minidump to disk, which means subsequent runs can't send the crash and it goes unreported.
let s:&u32 = unsafe{&*std::ptr::null()};println!("we are crashing by accessing a null reference: {}",*s);
With debug output enabled for the SDK, you should see a line saying [sentry] DEBUG failed to open file "/<uuid>.envelope" for writing
Expected behavior
The envelope should be serialized to disk, and subsequent runs should send those envelopes to the upstream sentry server for consumption and analysis.
Additional context
So after some digging, it appears as if some memory might be getting stomped during the before_send callback, I don't think it's in the native code as there doesn't seem to be much going on there, but I could of course be wrong. But basically, the options run field has the run_path which is the directory where sentry stores serialized envelopes and temporary crash dumps, but if the before_send callback is set and called, run_path ends up being an empty string, so when sentry creates the path to store the serialized envelope in by joining the run_path with the uuid + .envelope extension, which should be an absolute path, it ends up being just /<uuid>.envelope which then fails to be created and sentry gives up serializing the envelope and the crash is lost forever.
I would look into this more but once I realized that before_send was causing this I just stopped using it (it was only for logging purposes) so I could move on, but thought I would at least make this report so that there's a record of it. 🙂
The text was updated successfully, but these errors were encountered:
I would look into this more but once I realized that before_send was causing this I just stopped using it (it was only for logging purposes) so I could move on, but thought I would at least make this report so that there's a record of it. 🙂
Thank you so much!
Is this behaviour on Linux? Because when Linux is going to switch to Crashpad (which is going to be with the next release), set_before_send will never be called, because the program will crash anyway, so all problems will be dealt with Crashpad.
I really wanted to keep the scope of this project to support Crashpad only, too bad #9 happened, thank you anyway.
I will just copy paste this upstream.
Describe the bug
If
Options::set_before_send
is used, and a native crash occurs, sentry fails to serialize the envelope contain the minidump to disk, which means subsequent runs can't send the crash and it goes unreported.To Reproduce
[sentry] DEBUG failed to open file "/<uuid>.envelope" for writing
Expected behavior
The envelope should be serialized to disk, and subsequent runs should send those envelopes to the upstream sentry server for consumption and analysis.
Environment:
Additional context
So after some digging, it appears as if some memory might be getting stomped during the before_send callback, I don't think it's in the native code as there doesn't seem to be much going on there, but I could of course be wrong. But basically, the options
run
field has therun_path
which is the directory where sentry stores serialized envelopes and temporary crash dumps, but if the before_send callback is set and called, run_path ends up being an empty string, so when sentry creates the path to store the serialized envelope in by joining the run_path with the uuid + .envelope extension, which should be an absolute path, it ends up being just/<uuid>.envelope
which then fails to be created and sentry gives up serializing the envelope and the crash is lost forever.I would look into this more but once I realized that before_send was causing this I just stopped using it (it was only for logging purposes) so I could move on, but thought I would at least make this report so that there's a record of it. 🙂
The text was updated successfully, but these errors were encountered: