Integration
sentry-android-ndk
Build System
Gradle
AGP Version
9.3.0
Proguard
Enabled
Other Error Monitoring Solution
No
Version
8.40.0
Steps to Reproduce
- Force a native crash, so that the OS records a
Tombstone
- Restart the app:
BeforeSendCallback is called for that crash (possibly a TombstoneMerged), discard it
- Restart the app again:
BeforeSendCallback is called with a new event (Tombstone), carrying a different event timestamp, discard it
- Restart the app again:
BeforeSendCallback is called with a new event (Tombstone), with the same event timestamp, discard it
- Every subsequent restart does the same, until the event is not discarded
Expected Result
Tombstone events discarded from SentryOptions.BeforeSendCallback are reported again at every app launch, until one of them is not discarded. This makes it hard to drop them based on some heuristic. A discarded crash should stay discarded.
As far as I can tell, this happens because the LAST_TOMBSTONE_REPORT marker is not written if the event is discarded.
We currently work around that by retrieving the crash timestamp from the hint, through the internal HintUtils.getSentrySdkHint() and NativeCrashExit, and use that in our heuristic. The timestamp of the event passed to BeforeSendCallback proved to be insufficient as the same crash can be first passed as TombstoneMerged and as a seemingly different Tombstone with a different event timestamp at a subsequent app start.
This behavior is a bit surprising, especially because it differs from how signalhandler events are handled. If this was intended and this is not a bug, please provide an easy way to discard events reliably without having to rely on internal APIs.
I believe the same holds true for ANRs, but I haven't really looked at those.
Actual Result
N/A
Integration
sentry-android-ndk
Build System
Gradle
AGP Version
9.3.0
Proguard
Enabled
Other Error Monitoring Solution
No
Version
8.40.0
Steps to Reproduce
TombstoneBeforeSendCallbackis called for that crash (possibly aTombstoneMerged), discard itBeforeSendCallbackis called with a new event (Tombstone), carrying a different event timestamp, discard itBeforeSendCallbackis called with a new event (Tombstone), with the same event timestamp, discard itExpected Result
Tombstoneevents discarded fromSentryOptions.BeforeSendCallbackare reported again at every app launch, until one of them is not discarded. This makes it hard to drop them based on some heuristic. A discarded crash should stay discarded.As far as I can tell, this happens because the
LAST_TOMBSTONE_REPORTmarker is not written if the event is discarded.We currently work around that by retrieving the crash timestamp from the hint, through the internal
HintUtils.getSentrySdkHint()andNativeCrashExit, and use that in our heuristic. The timestamp of the event passed toBeforeSendCallbackproved to be insufficient as the same crash can be first passed asTombstoneMergedand as a seemingly differentTombstonewith a different event timestamp at a subsequent app start.This behavior is a bit surprising, especially because it differs from how
signalhandlerevents are handled. If this was intended and this is not a bug, please provide an easy way to discard events reliably without having to rely on internal APIs.I believe the same holds true for ANRs, but I haven't really looked at those.
Actual Result
N/A