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

Sentry crashes on app start #2246

Closed
mgenware opened this issue Aug 25, 2024 · 8 comments
Closed

Sentry crashes on app start #2246

mgenware opened this issue Aug 25, 2024 · 8 comments
Assignees

Comments

@mgenware
Copy link

Platform

Dart

Obfuscation

Enabled

Debug Info

Enabled

Doctor

NOTE that I'm using flutter 3.24.1 now, but the crash happens on an app built with flutter 3.24.0

[✓] Flutter (Channel stable, 3.24.1, on macOS 14.6.1 23G93 darwin-arm64, locale
    en-CN)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.dev/to/macos-android-setup for detailed
      instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.92.2)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for Huawei Mate 90 Extreme.
      Ensure the device is unlocked and attached with a cable or associated with
      the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code
      -27)
[✓] Network resources

Version

8.7.0

Steps to Reproduce

Crash on an app downloaded from app store

Expected Result

No crash

Actual Result

crash.log

Are you willing to submit a PR?

None

@mgenware
Copy link
Author

I can repro locally

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSConcreteData subdataWithRange:]: range {174, 313} exceeds data length 173'
*** First throw call stack:
(
        0   CoreFoundation                      0x000000019758e2ec __exceptionPreprocess + 176
        1   libobjc.A.dylib                     0x0000000197072158 objc_exception_throw + 60
        2   Foundation                          0x000000019863a41c -[NSProgress initWithParent:userInfo:] + 0
        3   Sentry                              0x0000000102f7cd6c +[SentrySerialization envelopeWithData:] + 1360
        4   Sentry                              0x0000000102f5db0c +[SentryMigrateSessionInit setInitFlagOnNextEnvelopeWithSameSessionId:envelopesDirPath:envelopeFilePaths:] + 276
        5   Sentry                              0x0000000102f5d93c +[SentryMigrateSessionInit migrateSessionInit:envelopesDirPath:envelopeFilePaths:] + 400
        6   Sentry                              0x0000000102f4c980 -[SentryFileManager handleEnvelopesLimit] + 448
        7   Sentry                              0x0000000102f4c4fc -[SentryFileManager storeEnvelope:] + 792
        8   Sentry                              0x0000000102f51b1c __36-[SentryHttpTransport sendEnvelope:]_block_invoke + 60
        9   Sentry                              0x0000000102f452c8 __53-[SentryDispatchQueueWrapper dispatchAsyncWithBlock:]_block_invoke + 36
        10  libdispatch.dylib                   0x0000000197287750 _dispatch_call_block_and_release + 32
        11  libdispatch.dylib                   0x00000001972893e8 _dispatch_client_callout + 20
        12  libdispatch.dylib                   0x0000000197290a14 _dispatch_lane_serial_drain + 748
        13  libdispatch.dylib                   0x0000000197291544 _dispatch_lane_invoke + 380
        14  libdispatch.dylib                   0x000000019729c2d0 _dispatch_root_queue_drain_deferred_wlh + 288
        15  libdispatch.dylib                   0x000000019729bb44 _dispatch_workloop_worker_thread + 404
        16  libsystem_pthread.dylib             0x000000019743600c _pthread_wqthread + 288
        17  libsystem_pthread.dylib             0x0000000197434d28 start_wqthread + 8
)
libc++abi: terminating due to uncaught exception of type NSException

@mgenware
Copy link
Author

More info

*** -[NSConcreteData subdataWithRange:]: range {174, 313} exceeds data length 173

Image

@mgenware
Copy link
Author

OK, it seems like sentry cannot handle some local tmp files stored in /<app>/Data/Library/Caches/io.sentry/

@mgenware
Copy link
Author

mgenware commented Aug 25, 2024

Here are some possible repro steps (not sure if 100% happens). The app actually works fine, let's say v1 from app store. Then we had a v2 in development, and we built and ran v2 in release mode. I guess that replaced v1 in place and changed some sentry logs? And then we deleted v2 and reinstalled v1 from app store. Now it crashes every time when it starts.

@buenaflor
Copy link
Contributor

I think this might be related to: getsentry/sentry-cocoa#4280 (comment)

@buenaflor
Copy link
Contributor

we're waiting for a cocoa hotfix 8.35.1, merge this into flutter and then also do a flutter release

@denrase denrase moved this from Needs Discussion to In Progress in Mobile & Cross Platform SDK Aug 27, 2024
@buenaflor
Copy link
Contributor

buenaflor commented Aug 27, 2024

we've released flutter 8.8.0, please see if this fixes the issue for you @mgenware

@buenaflor buenaflor moved this from In Progress to Needs More Information in Mobile & Cross Platform SDK Aug 27, 2024
@buenaflor buenaflor moved this to Waiting for: Community in GitHub Issues with 👀 3 Aug 27, 2024
@buenaflor
Copy link
Contributor

We have deprecated Sentry Cocoa 8.33.0 version in Sentry Flutter 8.7.0 so we urge to upgrade to 8.8.0 Please read the discussion for more info

@github-project-automation github-project-automation bot moved this from Needs More Information to Done in Mobile & Cross Platform SDK Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

No branches or pull requests

3 participants