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

bug(live-update): concurrency cooperative queue crash #319

Closed
5 of 24 tasks
robingenz opened this issue Nov 6, 2024 · 1 comment
Closed
5 of 24 tasks

bug(live-update): concurrency cooperative queue crash #319

robingenz opened this issue Nov 6, 2024 · 1 comment
Assignees
Labels
bug/fix Something isn't working package: live-update platform: ios iOS platform

Comments

@robingenz
Copy link
Member

Plugin(s)

  • Android Foreground Service
  • Android Battery Optimization
  • App Update
  • Background Task
  • Badge
  • Bluetooth Low Energy
  • Cloudinary
  • Datetime Picker
  • File Compressor
  • File Opener
  • File Picker
  • Live Update
  • Managed Configurations
  • NFC
  • Photo Editor
  • Printer
  • Screen Orientation
  • Zip

Version

6.6.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

The following error occurs on some devices under iOS:

Crashed: com.apple.root.user-initiated-qos.cooperative
0  App                            0x95604 specialized LiveUpdateHttpClient.request<A>(url:type:) + 36 (LiveUpdateHttpClient.swift:36)
1  libswift_Concurrency.dylib     0x5ecec <redacted> + 420
2  libswift_Concurrency.dylib     0x6003c <redacted> + 76
3  libdispatch.dylib              0x15df4 <redacted> + 392
4  libdispatch.dylib              0x165f8 <redacted> + 156
5  libsystem_pthread.dylib        0x4c40 _pthread_wqthread + 228
6  libsystem_pthread.dylib        0x1488 start_wqthread + 8
Full stack trace
# Crashlytics - Stack trace
# Application: <REDACTED>
# Platform: apple
# Version: <REDACTED>
# Issue: <REDACTED>
# Session: <REDACTED>
# Date: Tue Nov 05 2024 12:48:57 GMT+0200 (Eastern European Standard Time)

com.apple.main-thread
0  libsystem_kernel.dylib         0x1708 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e18 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4d30 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4b7c mach_msg + 24
4  CoreFoundation                 0x539c4 <redacted> + 160
5  CoreFoundation                 0x53078 <redacted> + 1228
6  CoreFoundation                 0x52714 CFRunLoopRunSpecific + 608
7  GraphicsServices               0x11c4 GSEventRunModal + 164
8  UIKitCore                      0x3e1564 <redacted> + 888
9  UIKitCore                      0x48f530 UIApplicationMain + 340
10 App                            0x9030 main + 7 (AppDelegate.swift:7)
11 ???                            0x1c3c0fcd0 (Missing)

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

com.apple.NSURLSession-work
0  libobjc.A.dylib                0xb5b8 objc_autoreleaseReturnValue + 128
1  CFNetwork                      0xc90ac <redacted> + 80
2  CFNetwork                      0xc8174 <redacted> + 232
3  CFNetwork                      0xc2c0c <redacted> + 36
4  libdispatch.dylib              0x13350 <redacted> + 148
5  libdispatch.dylib              0x4160 <redacted> + 20
6  libdispatch.dylib              0xb768 <redacted> + 744
7  libdispatch.dylib              0xc2a4 <redacted> + 432
8  libdispatch.dylib              0x172b8 <redacted> + 288
9  libdispatch.dylib              0x16b04 <redacted> + 532
10 libsystem_pthread.dylib        0x4c7c _pthread_wqthread + 288
11 libsystem_pthread.dylib        0x1488 start_wqthread + 8

com.apple.NSURLSession-work
0  libsystem_blocks.dylib         0x26a8 <redacted> + 192
1  libsystem_blocks.dylib         0x22e4 <redacted> + 60
2  libsystem_blocks.dylib         0x228c _Block_copy + 384
3  libdispatch.dylib              0x23c4 <redacted> + 32
4  libdispatch.dylib              0x8a84 dispatch_async + 56
5  CFNetwork                      0x25e80 <redacted> + 148
6  CFNetwork                      0x48dbc <redacted> + 224
7  CFNetwork                      0x48c90 <redacted> + 1120
8  CFNetwork                      0x4863c <redacted> + 404
9  libdispatch.dylib              0x2400 <redacted> + 32
10 libdispatch.dylib              0x4160 <redacted> + 20
11 libdispatch.dylib              0xb768 <redacted> + 744
12 libdispatch.dylib              0xc2a4 <redacted> + 432
13 libdispatch.dylib              0x172b8 <redacted> + 288
14 libdispatch.dylib              0x16b04 <redacted> + 532
15 libsystem_pthread.dylib        0x4c7c _pthread_wqthread + 288
16 libsystem_pthread.dylib        0x1488 start_wqthread + 8

Crashed: com.apple.root.user-initiated-qos.cooperative
0  App                            0x95604 specialized LiveUpdateHttpClient.request<A>(url:type:) + 36 (LiveUpdateHttpClient.swift:36)
1  libswift_Concurrency.dylib     0x5ecec <redacted> + 420
2  libswift_Concurrency.dylib     0x6003c <redacted> + 76
3  libdispatch.dylib              0x15df4 <redacted> + 392
4  libdispatch.dylib              0x165f8 <redacted> + 156
5  libsystem_pthread.dylib        0x4c40 _pthread_wqthread + 228
6  libsystem_pthread.dylib        0x1488 start_wqthread + 8

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1708 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e18 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4d30 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4b7c mach_msg + 24
4  CoreFoundation                 0x539c4 <redacted> + 160
5  CoreFoundation                 0x53078 <redacted> + 1228
6  CoreFoundation                 0x52714 CFRunLoopRunSpecific + 608
7  Foundation                     0xb70b0 <redacted> + 212
8  Foundation                     0xb6f00 <redacted> + 64
9  UIKitCore                      0x3f48ac <redacted> + 420
10 Foundation                     0xc81ec <redacted> + 724
11 libsystem_pthread.dylib        0x637c _pthread_start + 136
12 libsystem_pthread.dylib        0x1494 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_pthread.dylib        0x1480 (Missing UUID 46e25446017937db91818cb0d0330bf6)

Thread
0  libsystem_kernel.dylib         0x7230 __semwait_signal + 8
1  libsystem_c.dylib              0x17a78 nanosleep + 220
2  libsystem_c.dylib              0x75550 sleep + 52
3  Intercom                       0xa3cc8 IntercomSDK_sentrycrashccd_init + 888
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

SentryCrash Exception Handler (Secondary)
0  libsystem_kernel.dylib         0x1708 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e18 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x2c7c thread_suspend + 108
3  Intercom                       0xaff58 IntercomSDK_sentrycrashcm_machexception_getAPI + 1144
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

SentryCrash Exception Handler (Primary)
0  libsystem_kernel.dylib         0x1708 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e18 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4d30 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4b7c mach_msg + 24
4  Intercom                       0xaff84 IntercomSDK_sentrycrashcm_machexception_getAPI + 1188
5  libsystem_pthread.dylib        0x637c _pthread_start + 136
6  libsystem_pthread.dylib        0x1494 thread_start + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1708 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e18 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4d30 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4b7c mach_msg + 24
4  CoreFoundation                 0x539c4 <redacted> + 160
5  CoreFoundation                 0x53078 <redacted> + 1228
6  CoreFoundation                 0x52714 CFRunLoopRunSpecific + 608
7  CFNetwork                      0xfd9e0 <redacted> + 416
8  Foundation                     0xc81ec <redacted> + 724
9  libsystem_pthread.dylib        0x637c _pthread_start + 136
10 libsystem_pthread.dylib        0x1494 thread_start + 8

io.sentry.app-hang-tracker
0  libsystem_kernel.dylib         0x7230 __semwait_signal + 8
1  libsystem_c.dylib              0x17a78 nanosleep + 220
2  Foundation                     0x1d47e8 <redacted> + 160
3  Intercom                       0x928c8 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 51896
4  Foundation                     0xc81ec <redacted> + 724
5  libsystem_pthread.dylib        0x637c _pthread_start + 136
6  libsystem_pthread.dylib        0x1494 thread_start + 8

JavaScriptCore libpas scavenger
0  libsystem_kernel.dylib         0x7010 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x3a50 <redacted> + 1204
2  JavaScriptCore                 0x1559ee8 <redacted> + 1316
3  libsystem_pthread.dylib        0x637c _pthread_start + 136
4  libsystem_pthread.dylib        0x1494 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

com.google.firebase.crashlytics.MachExceptionServer
0  FirebaseCrashlytics            0x1db5c FIRCLSProcessRecordAllThreads + 184
1  FirebaseCrashlytics            0x1df40 FIRCLSProcessRecordAllThreads + 1180
2  FirebaseCrashlytics            0x14dcc FIRCLSHandler + 48
3  FirebaseCrashlytics            0x17758 FIRCLSMachExceptionServer + 688
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1490 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_pthread.dylib        0x1480 (Missing UUID 46e25446017937db91818cb0d0330bf6)

Thread
0  libsystem_kernel.dylib         0x7230 __semwait_signal + 8
1  libsystem_c.dylib              0x17a78 nanosleep + 220
2  libsystem_c.dylib              0x75550 sleep + 52
3  Sentry                         0x1b794 monitorCachedData + 660
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

SentryCrash Exception Handler (Secondary)
0  libsystem_kernel.dylib         0x1708 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e18 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4d30 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4b7c mach_msg + 24
4  Sentry                         0x26400 handleExceptions + 168
5  libsystem_pthread.dylib        0x637c _pthread_start + 136
6  libsystem_pthread.dylib        0x1494 thread_start + 8

io.sentry.app-hang-tracker
0  libsystem_kernel.dylib         0x7230 __semwait_signal + 8
1  libsystem_c.dylib              0x17a78 nanosleep + 220
2  Foundation                     0x1d47e8 <redacted> + 160
3  Sentry                         0x5d00 -[SentryANRTracker detectANRs] + 556
4  Foundation                     0xc81ec <redacted> + 724
5  libsystem_pthread.dylib        0x637c _pthread_start + 136
6  libsystem_pthread.dylib        0x1494 thread_start + 8

Expected behavior

No error should occur and the app should not crash.

Reproduction

Steps to reproduce

  1. Call the sync() method

This problem only occurs on some devices.

Other information

No response

Capacitor doctor

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
@robingenz robingenz added platform: ios iOS platform bug/fix Something isn't working priority: high High priority package: live-update labels Nov 6, 2024
@robingenz robingenz self-assigned this Nov 6, 2024
@robingenz robingenz removed the priority: high High priority label Nov 7, 2024
@robingenz
Copy link
Member Author

robingenz commented Nov 7, 2024

The problem seems to be a runtime bug in iOS that occurs when using Tasks and TaskGroups. There are already several reports in the Swift forum. In previous iOS versions the problem has already been partially fixed by Apple. However, in certain cases and with newer iOS versions it can still occur.

Since only crashes with iOS 18.0.0 are currently being reported, I assume that Apple has already fixed this problem and am closing this issue. In any case, I cannot reproduce the problem with newer iOS versions.

In the meantime, I recommend one of the following two workarounds:

  1. Exclude iOS 18.0.0: I have simply disabled live updates in my apps for devices with iOS 18.0.0. As soon as these devices receive a new iOS version overnight, they will automatically receive live updates again. You can use the Capacitor Device plugin for this.
  2. Downgrade the plugin: Downgrade the Live Update plugin to version 6.4.2. Tasks and TaskGroups are not used there.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/fix Something isn't working package: live-update platform: ios iOS platform
Projects
None yet
Development

No branches or pull requests

1 participant