sentry-unity
sentry-unity copied to clipboard
CrashedLastRun is false if app gets out of memory termination
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which version of the SDK? 1.7.1
How did you install the package? (Git-URL, Assetstore) git url
Which version of Unity? 2021.3.37
Is this happening in Unity (editor) or on a player like Android, iOS, Windows? iOS, Android
Steps to Reproduce
- Open app
- Allocate 2gb memory by creating textures
- Game crashes
- Reopen game
- Cache SentryUnityOptions at SentryRuntimeConfiguration.cs
- Call
options.CrashedLastRun?.Invoke()after 10 sec
Expected Result
Have options.CrashedLastRun true because last session has a crash due out of memory
Actual Result
Have options.CrashedLastRun false
Any logs or screenshots
I get where you are coming from but the mechanism surrounding an Out Of Memor Crash is different and based on a heuristic and not a crash captured by the native SDKs. But I think that's a fair point, if the native SDKs assume that the app crashed due to an OOM event it should consider the the previous run as crashed. I'll bring this up with the team.
Hi @bitsandfoxes, do you have any ETA for this topic?
Sorry @andrey-vishnitskiy-hypemasters, unfortunately, we don't have an ETA yet.
Confirming, that as long as the native SDKs are reporting these terminations, the isCrashedLastRun should return true.
Confirming, that as long as the native SDKs are reporting these terminations, the isCrashedLastRun should return true.
@philipphofmann does the cocoa SDK report true on OOM?
No, it doesn't. It only returns true for crashedLastRun if SentryCrash detected a crash. I'm open to changing that if you think it makes sense.
https://github.com/getsentry/sentry-cocoa/blob/5c3fa88fefada71a9fd8c567cffd03f875dd94c7/Sources/Sentry/SentrySDK.m#L449-L452
I'm open to changing that if you think it makes sense.
Conceptionally, the game did not close down "on its own volution" which - in my opinion - constitutes as a "crash" from the users perspective. Especially, since the SDK now surfaces that CrashedLastRun, there will be issues with false positives.
I'm unsure if you think we should change crashedLastRun to include watchdog terminations and maybe also fatal app hangs or not?
Yes. I think crashedLastRun should cover OOM, watchdog terminations (are those the same thing) and also fatal app hangs if possible.
I created the issue: https://github.com/getsentry/sentry-cocoa/issues/4959.