Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Incorrect watchdog termination detection #3860

Open
TimBurik opened this issue Dec 19, 2024 · 2 comments
Open

[iOS] Incorrect watchdog termination detection #3860

TimBurik opened this issue Dec 19, 2024 · 2 comments

Comments

@TimBurik
Copy link

Package

Sentry

.NET Flavor

.NET

.NET Version

8.0.404

OS

iOS

SDK Version

4.13.0

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Initialize Sentry, keep WatchdogTerminationIntegration enabled;
  2. Generate managed app crashes
  3. Observe reports in Sentry dashboard, which have the mechanism=watchdog_termination

Unfortunately, we can't find 100% reproduction steps for this issue, but it seems to be happening only for managed crashes

Expected Result

Watchdog Termination events are not reported for the sessions, which had ended with a crash

Actual Result

Some Watchdog Termination events seems to duplicate crash reports:

  • reported from the same device with the same timestamp;
  • Watchdog Termination report has the same exception as a last breadcrumb;

Here is the example of such duplicated reports in raw json:

According to the sentry-cocoa implementation, in case if last session has a crash - it should not be reported as watchdog-terminated:
https://github.com/getsentry/sentry-cocoa/blob/0b53d9c1a9e75af96895ffa8b37c28a42094062d/Sources/Sentry/SentryWatchdogTerminationLogic.m#L86-L88

The only correlation in such issues we see is that they only happen for managed crashes (no native crash is duplicated), but definitely not every managed crash results in such a duplication. Is it possible that in some cases sentry-dotnet does not notify sentry-cocoa about session being terminated with a crash?

@bruno-garcia
Copy link
Member

Thanks for raising. Can you disable the feature for now while it's investigated? To unblock yourself I mean.

Generate managed app crashes

How are you causing this crash exactly?

This feature is based on some heuristics, as described on: https://docs.sentry.io/platforms/apple/guides/ios/configuration/watchdog-terminations/

The app didn't crash on the previous run.

As the docs say it checks if the app didn't crash. But this is done at the native layer, so a crash caused by .NET might not be detected.

According to the sentry-cocoa implementation, in case if last session has a crash - it should not be reported as watchdog-terminated:
https://github.com/getsentry/sentry-cocoa/blob/0b53d9c1a9e75af96895ffa8b37c28a42094062d/Sources/Sentry/SentryWatchdogTerminationLogic.m#L86-L88

The only correlation in such issues we see is that they only happen for managed crashes (no native crash is duplicated), but definitely not every managed crash results in such a duplication. Is it possible that in some cases sentry-dotnet does not notify sentry-cocoa about session being terminated with a crash?

Right, I should have read the end of the ticket before writing this :)

Sounds like .NET specific thing that affects that in any regard, so I suggest we just disable this feature by default until we can figure out details

@bruno-garcia
Copy link
Member

This was also something raised in the Unity repo, we should just disable this integration: getsentry/sentry-unity#1839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Waiting for: Product Owner
Development

No branches or pull requests

2 participants