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

App Hangs when File I/O Tracing is enabled

Open rodolfoBee opened this issue 1 year ago • 3 comments

Platform

iOS

Environment

Production

Installed

Swift Package Manager

Version

8.19.0

Did it work on previous versions?

No response

Steps to Reproduce

User is running into App Hangs after adding Sentry SDK to the application. From further investigate it happens when File IO Tracing is enable.

Expected Result

Application runs with File I/O Tracing enabled without any hangs.

Actual Result

When File I/O Tracing is enabled the app hangs, the issue is not reproducible when this option is disabled.

Two traces with and without the instrumentation are available in the internal ticket, not posting publicly due to possible PII.

Are you willing to submit a PR?

No response

rodolfoBee avatar Feb 07 '24 09:02 rodolfoBee

@rodolfoBee, the internal ticket contains two traces. The one with a severe app hang shows links to symbolicate_internal, which only runs when debug = true since 8.9.0. I recommend at least updating to 8.9.0 and to set debug = false to solve the problem for now. This is related to https://github.com/getsentry/sentry-cocoa/issues/3043.

The trace has frames to UIKeyboardImpl, so it seems like the NSDataSwizzling is reporting file IO on the main thread when the user types in textfield, which is related to https://github.com/getsentry/sentry/issues/62080.

CleanShot 2024-02-07 at 12 00 02

We could ignore the KBLayout_iPhone.dat locally in the SDK instead of ignoring it on the backend with https://github.com/getsentry/sentry/issues/62080.

After completing this issue, we should update the troubleshooting guide in the docs.

philipphofmann avatar Feb 07 '24 11:02 philipphofmann

This is related to https://github.com/getsentry/sentry-cocoa/issues/3304.

philipphofmann avatar Feb 08 '24 07:02 philipphofmann

We (@brustolin, @philipphofmann, @kahest) decided to never call symbolicate_internal for file IO on the main thread spans.

philipphofmann avatar Feb 14 '24 13:02 philipphofmann