Instabug / Instabug-SP

Other
11 stars 12 forks source link

[Bug]: Infinite loop causes app to crash after force quitting app #23

Open danniss10 opened 2 years ago

danniss10 commented 2 years ago

Steps to Reproduce the Problem

  1. Run the app
  2. Double tap home button (or swipe up bottom bar) to view app switcher
  3. Force quit app
  4. Observe crash alert notifying that app has crash

Actual Behavior

Crash occurs with some sort of infinite loop, see crash log below.

Instabug integration code

public func setupInstabug() {
        // Configuring instabug sdk
        var instabugKey = "xxxxxx"
        Instabug.start(withToken: instabugKey, invocationEvents: [.shake, .screenshot])
        Instabug.welcomeMessageMode = .disabled
        CrashReporting.enabled = true
        CrashReporting.oomEnabled = true
        NetworkLogger.enabled = true
    }

SDK Version

Instabug 11.4.1

iOS Version

Observed in iOS 16, 15, 14 crash reports

Device Model

Multiple

Crash log

Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 57CD9EBD-29DB-4C79-865B-61C4717A620C
Beta Identifier:     E1CC0C50-39E2-4306-97EA-6DE3229D8DB2
Hardware Model:      iPhone15,2
Process:             xxxxxx [52374]
Path:                /private/var/containers/Bundle/Application/119BC915-1BE0-411D-A682-BA6523133F5E/xxxxxx.app/xxxxxx
Identifier:          com.xxxxxx.debug
Version:             4.2.0 (8)
AppStoreTools:       14B44
AppVariant:          1:iPhone15,2:16
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Non UI
Parent Process:      launchd [1]
Coalition:           com.xxxxxx.debug [8995]

Date/Time:           2022-10-27 11:46:29.2078 -0400
Launch Time:         2022-10-27 11:44:45.4504 -0400
OS Version:          iPhone OS 16.0.3 (20A392)
Release Type:        User
Baseband Version:    1.00.08
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000016b1fbff8
Exception Codes: 0x0000000000000002, 0x000000016b1fbff8
VM Region Info: 0x16b1fbff8 is in 0x16b1f8000-0x16b1fc000;  bytes after start: 16376  bytes before end: 7
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file              13524c000-135258000 [   48K] ---/--- SM=COW  ...t_id=d9d0867f
      GAP OF 0x35fa0000 BYTES
--->  STACK GUARD              16b1f8000-16b1fc000 [   16K] ---/rwx SM=NUL  ... for thread 0
      Stack                    16b1fc000-16b2f8000 [ 1008K] rw-/rwx SM=PRV  thread 0
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [52374]

Triggered by Thread:  0

Kernel Triage:
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_pthread.dylib                0x1e27e0be4 ___chkstk_darwin + 60
1   libdispatch.dylib                      0x19d3592f8 _dispatch_mach_send_and_wait_for_reply + 432
2   libdispatch.dylib                      0x19d3596ec dispatch_mach_send_with_result_and_wait_for_reply + 60
3   libxpc.dylib                           0x1e28337ac xpc_connection_send_message_with_reply_sync + 240
4   CoreFoundation                         0x195f599f4 __99-[CFPrefsPlistSource sendFullyPreparedMessage:toConnection:settingValues:forKeys:count:retryCount:]_block_invoke + 64
5   CoreFoundation                         0x19605803c -[_CFXPreferences withConnectionForRole:andUserIdentifier:performBlock:] + 52
6   CoreFoundation                         0x195fb6874 -[CFPrefsPlistSource sendFullyPreparedMessage:toConnection:settingValues:forKeys:count:retryCount:] + 316
7   CoreFoundation                         0x195f0d758 -[CFPrefsPlistSource sendMessageSettingValues:forKeys:count:] + 828
8   CoreFoundation                         0x195efeed0 -[CFPrefsPlistSource alreadylocked_setPrecopiedValues:forKeys:count:from:] + 1264
9   CoreFoundation                         0x195efdf10 -[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:] + 420
10  CoreFoundation                         0x195efe9d0 -[CFPrefsSource setValues:forKeys:count:copyValues:from:] + 36
11  CoreFoundation                         0x195efe510 -[CFPrefsSearchListSource alreadylocked_setPrecopiedValues:forKeys:count:from:] + 1004
12  CoreFoundation                         0x195efdf10 -[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:] + 420
13  CoreFoundation                         0x195efdd44 -[CFPrefsSource setValue:forKey:from:] + 72
14  CoreFoundation                         0x195efdc74 __76-[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:]_block_invoke + 60
15  CoreFoundation                         0x195f54fe4 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 392
16  CoreFoundation                         0x195f40bb8 normalizeQuintuplet + 356
17  CoreFoundation                         0x195f3d458 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 152
18  CoreFoundation                         0x195ee3b34 -[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:] + 128
19  CoreFoundation                         0x195ee3a70 _CFPreferencesSetAppValueWithContainerAndConfiguration + 120
20  Foundation                             0x1903585ac -[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 68
21  Instabug                               0x10b9022b4 0x10b794000 + 1499828
22  Instabug                               0x10b90235c 0x10b794000 + 1499996
23  Instabug                               0x10b913968 -[IBGDefaults setAppTerminationDetectedWithSwizzlingDate:] + 92
24  Instabug                               0x10bac7fa8 0x10b794000 + 3358632
25  Instabug                               0x10bad3e28 0x10b794000 + 3407400
26  Instabug                               0x10b938f00 __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 356
27  CoreFoundation                         0x195f2ca14 __invoking___ + 148
28  CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
29  OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
30  OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
31  Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
32  Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
33  CoreFoundation                         0x195f2ca14 __invoking___ + 148
34  CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
35  OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
36  OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
37  Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
38  Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
39  CoreFoundation                         0x195f2ca14 __invoking___ + 148
40  CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
41  OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
42  OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
43  Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
44  Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
...
406 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
407 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
408 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
409 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
410 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
411 CoreFoundation                         0x195f2ca14 __invoking___ + 148
412 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
413 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
414 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
415 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
416 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
417 CoreFoundation                         0x195f2ca14 __invoking___ + 148
418 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
419 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
420 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
421 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
422 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
423 CoreFoundation                         0x195f2ca14 __invoking___ + 148
424 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
425 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
426 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
427 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
428 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
429 CoreFoundation                         0x195f2ca14 __invoking___ + 148
430 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
431 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
432 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
433 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
434 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
435 CoreFoundation                         0x195f2ca14 __invoking___ + 148
436 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
437 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
438 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
439 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
440 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
441 CoreFoundation                         0x195f2ca14 __invoking___ + 148
442 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
443 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
444 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
445 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
446 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
447 CoreFoundation                         0x195f2ca14 __invoking___ + 148
448 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
449 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
450 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
451 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
452 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
453 CoreFoundation                         0x195f2ca14 __invoking___ + 148
454 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
455 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
456 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
457 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
458 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
459 CoreFoundation                         0x195f2ca14 __invoking___ + 148
460 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
461 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
462 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
463 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
464 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
465 CoreFoundation                         0x195f2ca14 __invoking___ + 148
466 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
467 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
468 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
469 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
470 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
471 CoreFoundation                         0x195f2ca14 __invoking___ + 148
472 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
473 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
474 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
475 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
476 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
477 CoreFoundation                         0x195f2ca14 __invoking___ + 148
478 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
479 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
480 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
481 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
482 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
483 CoreFoundation                         0x195f2ca14 __invoking___ + 148
484 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
485 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
486 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
487 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
488 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
489 CoreFoundation                         0x195f2ca14 __invoking___ + 148
490 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
491 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
492 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
493 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
494 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
495 CoreFoundation                         0x195f2ca14 __invoking___ + 148
496 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
497 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
498 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
499 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
500 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
501 CoreFoundation                         0x195f2ca14 __invoking___ + 148
502 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
503 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
504 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256
505 Instabug                               0x10b93a48c INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION + 16
506 Instabug                               0x10b938f3c __78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke + 416
507 CoreFoundation                         0x195f2ca14 __invoking___ + 148
508 CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
509 OneSignalCore                          0x10b058984 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 312
510 OneSignal                              0x10b113184 -[OneSignalAppDelegate oneSignalApplicationWillTerminate:] + 256

Thread 1 name:  com.apple.uikit.eventfetch-thread
Thread 1:
0   libsystem_kernel.dylib                 0x1d25a3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1d25b6008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1d25b6248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib                 0x1d25a408c mach_msg + 24
4   CoreFoundation                         0x195f32e00 __CFRunLoopServiceMachPort + 160
5   CoreFoundation                         0x195f34044 __CFRunLoopRun + 1232
6   CoreFoundation                         0x195f391e4 CFRunLoopRunSpecific + 612
7   Foundation                             0x19033d818 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8   Foundation                             0x19033d700 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9   UIKitCore                              0x19851d88c -[UIEventFetcher threadMain] + 436
10  Foundation                             0x190356ce8 __NSThread__start__ + 716
11  libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
12  libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 2:
0   libsystem_kernel.dylib                 0x1d25a3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1d25b6008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1d25b6248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib                 0x1d25a408c mach_msg + 24
4   Instabug                               0x10baf51c0 exception_server_thread + 188
5   libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
6   libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 3 name:  com.apple.CoreMotion.MotionThread
Thread 3:
0   libsystem_kernel.dylib                 0x1d25a3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1d25b6008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1d25b6248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib                 0x1d25a408c mach_msg + 24
4   CoreFoundation                         0x195f32e00 __CFRunLoopServiceMachPort + 160
5   CoreFoundation                         0x195f34044 __CFRunLoopRun + 1232
6   CoreFoundation                         0x195f391e4 CFRunLoopRunSpecific + 612
7   CoreFoundation                         0x195f7d014 CFRunLoopRun + 64
8   CoreMotion                             0x1a12b4b04 0x1a12a1000 + 80644
9   libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
10  libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 4 name:  com.apple.CFNetwork.CustomProtocols
Thread 4:
0   libsystem_kernel.dylib                 0x1d25a3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1d25b6008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1d25b6248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib                 0x1d25a408c mach_msg + 24
4   CoreFoundation                         0x195f32e00 __CFRunLoopServiceMachPort + 160
5   CoreFoundation                         0x195f34044 __CFRunLoopRun + 1232
6   CoreFoundation                         0x195f391e4 CFRunLoopRunSpecific + 612
7   CFNetwork                              0x197287bac 0x197033000 + 2444204
8   Foundation                             0x190356ce8 __NSThread__start__ + 716
9   libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
10  libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 5 name:  com.apple.NSURLConnectionLoader
Thread 5:
0   libsystem_kernel.dylib                 0x1d25a3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1d25b6008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1d25b6248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib                 0x1d25a408c mach_msg + 24
4   CoreFoundation                         0x195f32e00 __CFRunLoopServiceMachPort + 160
5   CoreFoundation                         0x195f34044 __CFRunLoopRun + 1232
6   CoreFoundation                         0x195f391e4 CFRunLoopRunSpecific + 612
7   CFNetwork                              0x197287bac 0x197033000 + 2444204
8   Foundation                             0x190356ce8 __NSThread__start__ + 716
9   libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
10  libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 6 name:  com.squareup.SocketRocket.NetworkThread
Thread 6:
0   libsystem_kernel.dylib                 0x1d25a3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1d25b6008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1d25b6248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib                 0x1d25a408c mach_msg + 24
4   CoreFoundation                         0x195f32e00 __CFRunLoopServiceMachPort + 160
5   CoreFoundation                         0x195f34044 __CFRunLoopRun + 1232
6   CoreFoundation                         0x195f391e4 CFRunLoopRunSpecific + 612
7   Foundation                             0x19033d818 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8   Intercom                               0x10b45e4d0 0x10b3d8000 + 550096
9   Foundation                             0x190356ce8 __NSThread__start__ + 716
10  libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
11  libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 7 name:  com.apple.CFSocket.private
Thread 7:
0   libsystem_kernel.dylib                 0x1d25a46ac __select + 8
1   CoreFoundation                         0x195f839d4 __CFSocketManager + 636
2   libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
3   libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 8:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 12:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 13:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 14:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 15 name:  com.apple.SwiftUI.AsyncRenderer
Thread 15:
0   libsystem_kernel.dylib                 0x1d25a3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1d25b6008 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1d25b6248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib                 0x1d25a408c mach_msg + 24
4   CoreFoundation                         0x195f32e00 __CFRunLoopServiceMachPort + 160
5   CoreFoundation                         0x195f34044 __CFRunLoopRun + 1232
6   CoreFoundation                         0x195f391e4 CFRunLoopRunSpecific + 612
7   Foundation                             0x19033d818 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8   Foundation                             0x19033d6ac -[NSRunLoop(NSRunLoop) run] + 64
9   SwiftUI                                0x1998ba558 0x19980d000 + 709976
10  SwiftUI                                0x1998b869c 0x19980d000 + 702108
11  Foundation                             0x190356ce8 __NSThread__start__ + 716
12  libsystem_pthread.dylib                0x1e27e16cc _pthread_start + 148
13  libsystem_pthread.dylib                0x1e27e0ba4 thread_start + 8

Thread 16:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 17:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 18 name:   Dispatch queue: com.apple.UIKit.KeyboardManagement
Thread 18:
0   libsystem_kernel.dylib                 0x1d25a4680 __ulock_wait + 8
1   libdispatch.dylib                      0x19d33e9cc _dlock_wait + 56
2   libdispatch.dylib                      0x19d33e780 _dispatch_thread_event_wait_slow + 56
3   libdispatch.dylib                      0x19d34d860 __DISPATCH_WAIT_FOR_QUEUE__ + 368
4   libdispatch.dylib                      0x19d34d40c _dispatch_sync_f_slow + 144
5   UIKitCore                              0x1983e905c __37-[_UIRemoteKeyboards startConnection]_block_invoke_3 + 156
6   CoreFoundation                         0x195f2ca14 __invoking___ + 148
7   CoreFoundation                         0x195ed8f2c -[NSInvocation invoke] + 428
8   Foundation                             0x19039cd38 __NSXPCCONNECTION_IS_CALLING_OUT_TO_REPLY_BLOCK__ + 16
9   Foundation                             0x19036e2fc -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 520
10  Foundation                             0x190948f44 __88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_5 + 188
11  libxpc.dylib                           0x1e28413e4 _xpc_connection_reply_callout + 124
12  libxpc.dylib                           0x1e283447c _xpc_connection_call_reply_async + 88
13  libdispatch.dylib                      0x19d33e05c _dispatch_client_callout3 + 20
14  libdispatch.dylib                      0x19d35bf58 _dispatch_mach_msg_async_reply_invoke + 344
15  libdispatch.dylib                      0x19d34556c _dispatch_lane_serial_drain + 376
16  libdispatch.dylib                      0x19d346214 _dispatch_lane_invoke + 436
17  libdispatch.dylib                      0x19d350e10 _dispatch_workloop_worker_thread + 652
18  libsystem_pthread.dylib                0x1e27e0df8 _pthread_wqthread + 288
19  libsystem_pthread.dylib                0x1e27e0b98 start_wqthread + 8

Thread 19:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 20:
0   libsystem_pthread.dylib                0x1e27e0b90 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000001   x1: 0x0000000000004000   x2: 0x0000000200131513   x3: 0x0000130300001b03
    x4: 0x400000000000dd07   x5: 0x0000000000000000   x6: 0x0056ff0000000000   x7: 0x0000000000000000
    x8: 0x0000000000004000   x9: 0x0000000000004000  x10: 0x000000016b1fbef0  x11: 0x000000016b1fc000
   x12: 0x000000000000ff00  x13: 0x0000000000000000  x14: 0x0000000600000000  x15: 0x0000002800000000
   x16: 0x00000001e27e0ba8  x17: 0x00000001ec095320  x18: 0x0000000000000000  x19: 0x0000000281700120
   x20: 0x000000016b20001f  x21: 0x00000001258f47c0  x22: 0x0000000000004000  x23: 0x0000000000001303
   x24: 0x000000002900004d  x25: 0x0000000000000000  x26: 0x0000000000001b03  x27: 0x00000002829adfb0
   x28: 0x00000001ec09aaa0   fp: 0x000000016b200000   lr: 0x000000019d3592f8
    sp: 0x000000016b1ffef0   pc: 0x00000001e27e0be4 cpsr: 0x80001000
   far: 0x000000016b1fbff8  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x1e27e0000 -        0x1e27ebfff libsystem_pthread.dylib arm64e  <e0674d941a2936b9a1f9ca129f0cfc7e> /usr/lib/system/libsystem_pthread.dylib
       0x19d33a000 -        0x19d380fff libdispatch.dylib arm64e  <c663d847b94f3fb0925432edbc55315e> /usr/lib/system/libdispatch.dylib
       0x1e2824000 -        0x1e2863fff libxpc.dylib arm64e  <bf679bcd7230311ba4da1dc48d787abc> /usr/lib/system/libxpc.dylib
       0x195eb8000 -        0x19629cfff CoreFoundation arm64e  <42c5c91704473995b50fde4d132c2435> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
       0x1902fc000 -        0x190c46fff Foundation arm64e  <aa92cd58561a341492f4b4120298b39a> /System/Library/Frameworks/Foundation.framework/Foundation
       0x10b794000 -        0x10bbd7fff Instabug arm64  <adc409d876da3bc8916a002e229a9449> /private/var/containers/Bundle/Application/119BC915-1BE0-411D-A682-BA6523133F5E/xxxxxx.app/Frameworks/Instabug.framework/Instabug
       0x10b054000 -        0x10b067fff OneSignalCore arm64  <59e57284c820361d8ae0f3241f3be390> /private/var/containers/Bundle/Application/119BC915-1BE0-411D-A682-BA6523133F5E/xxxxxx.app/Frameworks/OneSignalCore.framework/OneSignalCore
       0x10b0e4000 -        0x10b143fff OneSignal arm64  <7cbc4ca676693442bc2d5dad6b031c22> /private/var/containers/Bundle/Application/119BC915-1BE0-411D-A682-BA6523133F5E/xxxxxx.app/Frameworks/OneSignal.framework/OneSignal
       0x1d25a3000 -        0x1d25d9ffb libsystem_kernel.dylib arm64e  <d3eb8b567c223265a985a436bc8caf15> /usr/lib/system/libsystem_kernel.dylib
       0x198046000 -        0x19980cfff UIKitCore arm64e  <7b942fa4cb7633759972f58c14492fb4> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
       0x1a12a1000 -        0x1a1680fff CoreMotion arm64e  <1c7c3d6c33e33cf79fdfffdd45d7d3f0> /System/Library/Frameworks/CoreMotion.framework/CoreMotion
       0x197033000 -        0x1973f8fff CFNetwork arm64e  <35605de33723335a83d96f35f2989935> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
       0x10b3d8000 -        0x10b65ffff Intercom arm64  <946f9fbc777a3fc7ac5aa32556b19184> /private/var/containers/Bundle/Application/119BC915-1BE0-411D-A682-BA6523133F5E/xxxxxx.app/Frameworks/Intercom.framework/Intercom
       0x19980d000 -        0x19b055fff SwiftUI arm64e  <122e646e6b173561975fc414c8dae3d3> /System/Library/Frameworks/SwiftUI.framework/SwiftUI
               0x0 - 0xffffffffffffffff ??? unknown-arch  <00000000000000000000000000000000> ???

EOF

-----------
Full Report
-----------

{"roots_installed":0,"app_cohort":"2|date=1666823400000&sf=143441&tid=5b7a0c55da03a57a90e9be868a30c8806e789ff9a78348aacd4813b0ef46e8de&ttype=i","app_name":"xxxxxx","app_version":"4.2.0","timestamp":"2022-10-27 11:46:29.00 -0400","slice_uuid":"0c181679-f201-30d4-acdf-45491a7ce3ca","adam_id":"1546450106","build_version":"8","platform":2,"bundleID":"com.xxxxxx.debug","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"iPhone OS 16.0.3 (20A392)","incident_id":"57CD9EBD-29DB-4C79-865B-61C4717A620C","name":"xxxxxx","is_beta":1}
{
  "uptime" : 620000,
  "procRole" : "Non UI",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "iPhone15,2",
  "coalitionID" : 8995,
  "osVersion" : {
    "isEmbedded" : true,
    "train" : "iPhone OS 16.0.3",
    "releaseType" : "User",
    "build" : "20A392"
  },
  "captureTime" : "2022-10-27 11:46:29.2078 -0400",
  "incident" : "57CD9EBD-29DB-4C79-865B-61C4717A620C",
  "pid" : 52374,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2022-10-27 11:44:45.4504 -0400",
  "procStartAbsTime" : 14917835779258,
  "procExitAbsTime" : 14920325938170,
  "procName" : "xxxxxx",
  "procPath" : "\/private\/var\/containers\/Bundle\/Application\/119BC915-1BE0-411D-A682-BA6523133F5E\/xxxxxx.app\/xxxxxx",
  "bundleInfo" : {"CFBundleShortVersionString":"4.2.0","CFBundleVersion":"8","CFBundleIdentifier":"com.xxxxxx.debug","DTAppStoreToolsBuild":"14B44"},
  "storeInfo" : {"itemID":"1546450106","storeCohortMetadata":"2|date=1666823400000&sf=143441&tid=5b7a0c55da03a57a90e9be868a30c8806e789ff9a78348aacd4813b0ef46e8de&ttype=i","entitledBeta":true,"deviceIdentifierForVendor":"E1CC0C50-39E2-4306-97EA-6DE3229D8DB2","softwareVersionExternalIdentifier":"99268811","applicationVariant":"1:iPhone15,2:16","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "com.xxxxxx.debug",
  "isBeta" : 1,
  "basebandVersion" : "1.00.08",
  "vmRegionInfo" : "0x16b1fbff8 is in 0x16b1f8000-0x16b1fc000;  bytes after start: 16376  bytes before end: 7\n      REGION TYPE                 START - END      [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      mapped file              13524c000-135258000 [   48K] ---\/--- SM=COW  ...t_id=d9d0867f\n      GAP OF 0x35fa0000 BYTES\n--->  STACK GUARD              16b1f8000-16b1fc000 [   16K] ---\/rwx SM=NUL  ... for thread 0\n      Stack                    16b1fc000-16b2f8000 [ 1008K] rw-\/rwx SM=PRV  thread 0",
  "exception" : {"codes":"0x0000000000000002, 0x000000016b1fbff8","rawCodes":[2,6092210168],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_PROTECTION_FAILURE at 0x000000016b1fbff8"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":52374},
  "ktriageinfo" : "VM - pmap_enter retried due to resource shortage\nVM - pmap_enter retried due to resource shortage\nVM - pmap_enter retried due to resource shortage\nVM - pmap_enter retried due to resource shortage\nVM - pmap_enter retried due to resource shortage\n",
  "vmregioninfo" : "0x16b1fbff8 is in 0x16b1f8000-0x16b1fc000;  bytes after start: 16376  bytes before end: 7\n      REGION TYPE                 START - END      [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      mapped file              13524c000-135258000 [   48K] ---\/--- SM=COW  ...t_id=d9d0867f\n      GAP OF 0x35fa0000 BYTES\n--->  STACK GUARD              16b1f8000-16b1fc000 [   16K] ---\/rwx SM=NUL  ... for thread 0\n      Stack                    16b1fc000-16b2f8000 [ 1008K] rw-\/rwx SM=PRV  thread 0",
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":7169824,"threadState":{"x":[{"value":1},{"value":16384},{"value":8591185171},{"value":20903605836547},{"value":4611686018427444487},{"value":0},{"value":24487223462199296},{"value":0},{"value":16384},{"value":16384},{"value":6092209904},{"value":6092210176},{"value":65280},{"value":0},{"value":25769803776},{"value":171798691840},{"value":8094878632,"symbolLocation":0,"symbol":"___chkstk_darwin"},{"value":8255001376,"symbolLocation":0,"symbol":"OBJC_CLASS_$_OS_dispatch_mach_msg"},{"value":0},{"value":10761535776},{"value":6092226591},{"value":4925114304},{"value":16384},{"value":4867},{"value":687865933},{"value":0},{"value":6915},{"value":10781122480},{"value":8255023776,"symbolLocation":224,"symbol":"_main_thread"}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6932501240},"cpsr":{"value":2147487744},"fp":{"value":6092226560},"sp":{"value":6092226288},"esr":{"value":2449473543,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":8094878692,"matchesCrashFrame":1},"far":{"value":6092210168}},"queue":"com.apple.main-thread","frames":[{"imageOffset":3044,"symbol":"___chkstk_darwin","symbolLocation":60,"imageIndex":0},{"imageOffset":127736,"symbol":"_dispatch_mach_send_and_wait_for_reply","symbolLocation":432,"imageIndex":1},{"imageOffset":128748,"symbol":"dispatch_mach_send_with_result_and_wait_for_reply","symbolLocation":60,"imageIndex":1},{"imageOffset":63404,"symbol":"xpc_connection_send_message_with_reply_sync","symbolLocation":240,"imageIndex":2},{"imageOffset":662004,"symbol":"__99-[CFPrefsPlistSource sendFullyPreparedMessage:toConnection:settingValues:forKeys:count:retryCount:]_block_invoke","symbolLocation":64,"imageIndex":3},{"imageOffset":1703996,"symbol":"-[_CFXPreferences withConnectionForRole:andUserIdentifier:performBlock:]","symbolLocation":52,"imageIndex":3},{"imageOffset":1042548,"symbol":"-[CFPrefsPlistSource sendFullyPreparedMessage:toConnection:settingValues:forKeys:count:retryCount:]","symbolLocation":316,"imageIndex":3},{"imageOffset":350040,"symbol":"-[CFPrefsPlistSource sendMessageSettingValues:forKeys:count:]","symbolLocation":828,"imageIndex":3},{"imageOffset":290512,"symbol":"-[CFPrefsPlistSource alreadylocked_setPrecopiedValues:forKeys:count:from:]","symbolLocation":1264,"imageIndex":3},{"imageOffset":286480,"symbol":"-[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:]","symbolLocation":420,"imageIndex":3},{"imageOffset":289232,"symbol":"-[CFPrefsSource setValues:forKeys:count:copyValues:from:]","symbolLocation":36,"imageIndex":3},{"imageOffset":288016,"symbol":"-[CFPrefsSearchListSource alreadylocked_setPrecopiedValues:forKeys:count:from:]","symbolLocation":1004,"imageIndex":3},{"imageOffset":286480,"symbol":"-[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:]","symbolLocation":420,"imageIndex":3},{"imageOffset":286020,"symbol":"-[CFPrefsSource setValue:forKey:from:]","symbolLocation":72,"imageIndex":3},{"imageOffset":285812,"symbol":"__76-[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:]_block_invoke","symbolLocation":60,"imageIndex":3},{"imageOffset":643044,"symbol":"__108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke","symbolLocation":392,"imageIndex":3},{"imageOffset":560056,"symbol":"normalizeQuintuplet","symbolLocation":356,"imageIndex":3},{"imageOffset":545880,"symbol":"-[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:]","symbolLocation":152,"imageIndex":3},{"imageOffset":178996,"symbol":"-[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:]","symbolLocation":128,"imageIndex":3},{"imageOffset":178800,"symbol":"_CFPreferencesSetAppValueWithContainerAndConfiguration","symbolLocation":120,"imageIndex":3},{"imageOffset":378284,"symbol":"-[NSUserDefaults(NSUserDefaults) setObject:forKey:]","symbolLocation":68,"imageIndex":4},{"imageOffset":1499828,"imageIndex":5},{"imageOffset":1499996,"imageIndex":5},{"imageOffset":1571176,"symbol":"-[IBGDefaults setAppTerminationDetectedWithSwizzlingDate:]","symbolLocation":92,"imageIndex":5},{"imageOffset":3358632,"imageIndex":5},{"imageOffset":3407400,"imageIndex":5},{"imageOffset":1724160,"symbol":"__78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke","symbolLocation":356,"imageIndex":5},{"imageOffset":477716,"symbol":"__invoking___","symbolLocation":148,"imageIndex":3},{"imageOffset":134956,"symbol":"-[NSInvocation invoke]","symbolLocation":428,"imageIndex":3},{"imageOffset":18820,"symbol":"+[SwizzlingForwarder callSelector:onObject:withArgs:]","symbolLocation":312,"imageIndex":6},{"imageOffset":192900,"symbol":"-[OneSignalAppDelegate oneSignalApplicationWillTerminate:]","symbolLocation":256,"imageIndex":7},{"imageOffset":1729676,"symbol":"INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION","symbolLocation":16,"imageIndex":5},{"imageOffset":1724220,"symbol":"__78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke","symbolLocation":416,"imageIndex":5},{"imageOffset":477716,"symbol":"__invoking___","symbolLocation":148,"imageIndex":3},{"imageOffset":134956,"symbol":"-[NSInvocation invoke]","symbolLocation":428,"imageIndex":3},{"imageOffset":18820,"symbol":"+[SwizzlingForwarder callSelector:onObject:withArgs:]","symbolLocation":312,"imageIndex":6},{"imageOffset":192900,"symbol":"-[OneSignalAppDelegate oneSignalApplicationWillTerminate:]","symbolLocation":256,"imageIndex":7},{"imageOffset":1729676,"symbol":"INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION","symbolLocation":16,"imageIndex":5},{"imageOffset":1724220,"symbol":"__78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke","symbolLocation":416,"imageIndex":5},{"imageOffset":477716,"symbol":"__invoking___","symbolLocation":148,"imageIndex":3},{"imageOffset":134956,"symbol":"-[NSInvocation invoke]","symbolLocation":428,"imageIndex":3},{"imageOffset":18820,"symbol":"+[SwizzlingForwarder callSelector:onObject:withArgs:]","symbolLocation":312,"imageIndex":6},{"imageOffset":192900,"symbol":"-[OneSignalAppDelegate oneSignalApplicationWillTerminate:]","symbolLocation":256,"imageIndex":7},{"imageOffset":1729676,"symbol":"INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION","symbolLocation":16,"imageIndex":5},{"imageOffset":1724220,"symbol":"__78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke","symbolLocation":416,"imageIndex":5},{"imageOffset":477716,"symbol":"__invoking___","symbolLocation":148,"imageIndex":3},{"imageOffset":134956,"symbol":"-[NSInvocation invoke]","symbolLocation":428,"imageIndex":3},{"imageOffset":18820,"symbol":"+[SwizzlingForwarder callSelector:onObject:withArgs:]","symbolLocation":312,"imageIndex":6},{"imageOffset":192900,"symbol":"-[OneSignalAppDelegate oneSignalApplicationWillTerminate:]","symbolLocation":256,"imageIndex":7},{"imageOffset":1729676,"symbol":"INSTABUG_SWIZZLER_EXECUTING_ORIGINAL_IMPLEMENTATION","symbolLocation":16,"imageIndex":5},{"imageOffset":1724220,"symbol":"__78-[IBGSwizzler newImplementatioApplicationWillTerminate:selector:swizzlerInfo:]_block_invoke","symbolLocation":416,"imageIndex":5},{"imageOffset":477716,"symbol":"__invoking___","symbolLocation":148,"imageIndex":3},{"imageOffset":134956,"symbol":"-[NSInvocation invoke]","symbolLocation":428,"imageIndex":3},{"imageOffset":18820,"symbol":"+[SwizzlingForwarder callSelector:onObject:withArgs:]","symbolLocation":312,"imageIndex":6},{"imageOffset":192900,"symbol":"-[OneSignalAppDelegate oneSignalApplicationWillTerminate:]","symbolLocation":256,"imageIndex":7}]},{"id":7169857,"name":"com.apple.uikit.eventfetch-thread","frames":[{"imageOffset":2888,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":77832,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":8},{"imageOffset":78408,"symbol":"mach_msg_overwrite","symbolLocation":388,"imageIndex":8},{"imageOffset":4236,"symbol":"mach_msg","symbolLocation":24,"imageIndex":8},{"imageOffset":503296,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":160,"imageIndex":3},{"imageOffset":507972,"symbol":"__CFRunLoopRun","symbolLocation":1232,"imageIndex":3},{"imageOffset":528868,"symbol":"CFRunLoopRunSpecific","symbolLocation":612,"imageIndex":3},{"imageOffset":268312,"symbol":"-[NSRunLoop(NSRunLoop) runMode:beforeDate:]","symbolLocation":212,"imageIndex":4},{"imageOffset":268032,"symbol":"-[NSRunLoop(NSRunLoop) runUntilDate:]","symbolLocation":64,"imageIndex":4},{"imageOffset":5077132,"symbol":"-[UIEventFetcher threadMain]","symbolLocation":436,"imageIndex":9},{"imageOffset":371944,"symbol":"__NSThread__start__","symbolLocation":716,"imageIndex":4},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7169859,"frames":[{"imageOffset":2888,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":77832,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":8},{"imageOffset":78408,"symbol":"mach_msg_overwrite","symbolLocation":388,"imageIndex":8},{"imageOffset":4236,"symbol":"mach_msg","symbolLocation":24,"imageIndex":8},{"imageOffset":3543488,"symbol":"exception_server_thread","symbolLocation":188,"imageIndex":5},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7169861,"name":"com.apple.CoreMotion.MotionThread","frames":[{"imageOffset":2888,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":77832,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":8},{"imageOffset":78408,"symbol":"mach_msg_overwrite","symbolLocation":388,"imageIndex":8},{"imageOffset":4236,"symbol":"mach_msg","symbolLocation":24,"imageIndex":8},{"imageOffset":503296,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":160,"imageIndex":3},{"imageOffset":507972,"symbol":"__CFRunLoopRun","symbolLocation":1232,"imageIndex":3},{"imageOffset":528868,"symbol":"CFRunLoopRunSpecific","symbolLocation":612,"imageIndex":3},{"imageOffset":806932,"symbol":"CFRunLoopRun","symbolLocation":64,"imageIndex":3},{"imageOffset":80644,"imageIndex":10},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7169908,"name":"com.apple.CFNetwork.CustomProtocols","frames":[{"imageOffset":2888,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":77832,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":8},{"imageOffset":78408,"symbol":"mach_msg_overwrite","symbolLocation":388,"imageIndex":8},{"imageOffset":4236,"symbol":"mach_msg","symbolLocation":24,"imageIndex":8},{"imageOffset":503296,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":160,"imageIndex":3},{"imageOffset":507972,"symbol":"__CFRunLoopRun","symbolLocation":1232,"imageIndex":3},{"imageOffset":528868,"symbol":"CFRunLoopRunSpecific","symbolLocation":612,"imageIndex":3},{"imageOffset":2444204,"imageIndex":11},{"imageOffset":371944,"symbol":"__NSThread__start__","symbolLocation":716,"imageIndex":4},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7169934,"name":"com.apple.NSURLConnectionLoader","frames":[{"imageOffset":2888,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":77832,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":8},{"imageOffset":78408,"symbol":"mach_msg_overwrite","symbolLocation":388,"imageIndex":8},{"imageOffset":4236,"symbol":"mach_msg","symbolLocation":24,"imageIndex":8},{"imageOffset":503296,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":160,"imageIndex":3},{"imageOffset":507972,"symbol":"__CFRunLoopRun","symbolLocation":1232,"imageIndex":3},{"imageOffset":528868,"symbol":"CFRunLoopRunSpecific","symbolLocation":612,"imageIndex":3},{"imageOffset":2444204,"imageIndex":11},{"imageOffset":371944,"symbol":"__NSThread__start__","symbolLocation":716,"imageIndex":4},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7169962,"name":"com.squareup.SocketRocket.NetworkThread","frames":[{"imageOffset":2888,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":77832,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":8},{"imageOffset":78408,"symbol":"mach_msg_overwrite","symbolLocation":388,"imageIndex":8},{"imageOffset":4236,"symbol":"mach_msg","symbolLocation":24,"imageIndex":8},{"imageOffset":503296,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":160,"imageIndex":3},{"imageOffset":507972,"symbol":"__CFRunLoopRun","symbolLocation":1232,"imageIndex":3},{"imageOffset":528868,"symbol":"CFRunLoopRunSpecific","symbolLocation":612,"imageIndex":3},{"imageOffset":268312,"symbol":"-[NSRunLoop(NSRunLoop) runMode:beforeDate:]","symbolLocation":212,"imageIndex":4},{"imageOffset":550096,"imageIndex":12},{"imageOffset":371944,"symbol":"__NSThread__start__","symbolLocation":716,"imageIndex":4},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7169965,"name":"com.apple.CFSocket.private","frames":[{"imageOffset":5804,"symbol":"__select","symbolLocation":8,"imageIndex":8},{"imageOffset":834004,"symbol":"__CFSocketManager","symbolLocation":636,"imageIndex":3},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7170483,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171210,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171212,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171395,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171616,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171617,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171618,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171781,"name":"com.apple.SwiftUI.AsyncRenderer","frames":[{"imageOffset":2888,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":8},{"imageOffset":77832,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":8},{"imageOffset":78408,"symbol":"mach_msg_overwrite","symbolLocation":388,"imageIndex":8},{"imageOffset":4236,"symbol":"mach_msg","symbolLocation":24,"imageIndex":8},{"imageOffset":503296,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":160,"imageIndex":3},{"imageOffset":507972,"symbol":"__CFRunLoopRun","symbolLocation":1232,"imageIndex":3},{"imageOffset":528868,"symbol":"CFRunLoopRunSpecific","symbolLocation":612,"imageIndex":3},{"imageOffset":268312,"symbol":"-[NSRunLoop(NSRunLoop) runMode:beforeDate:]","symbolLocation":212,"imageIndex":4},{"imageOffset":267948,"symbol":"-[NSRunLoop(NSRunLoop) run]","symbolLocation":64,"imageIndex":4},{"imageOffset":709976,"imageIndex":13},{"imageOffset":702108,"imageIndex":13},{"imageOffset":371944,"symbol":"__NSThread__start__","symbolLocation":716,"imageIndex":4},{"imageOffset":5836,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":0},{"imageOffset":2980,"symbol":"thread_start","symbolLocation":8,"imageIndex":0}]},{"id":7171829,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171839,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171841,"queue":"com.apple.UIKit.KeyboardManagement","frames":[{"imageOffset":5760,"symbol":"__ulock_wait","symbolLocation":8,"imageIndex":8},{"imageOffset":18892,"symbol":"_dlock_wait","symbolLocation":56,"imageIndex":1},{"imageOffset":18304,"symbol":"_dispatch_thread_event_wait_slow","symbolLocation":56,"imageIndex":1},{"imageOffset":79968,"symbol":"__DISPATCH_WAIT_FOR_QUEUE__","symbolLocation":368,"imageIndex":1},{"imageOffset":78860,"symbol":"_dispatch_sync_f_slow","symbolLocation":144,"imageIndex":1},{"imageOffset":3813468,"symbol":"__37-[_UIRemoteKeyboards startConnection]_block_invoke_3","symbolLocation":156,"imageIndex":9},{"imageOffset":477716,"symbol":"__invoking___","symbolLocation":148,"imageIndex":3},{"imageOffset":134956,"symbol":"-[NSInvocation invoke]","symbolLocation":428,"imageIndex":3},{"imageOffset":658744,"symbol":"__NSXPCCONNECTION_IS_CALLING_OUT_TO_REPLY_BLOCK__","symbolLocation":16,"imageIndex":4},{"imageOffset":467708,"symbol":"-[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:]","symbolLocation":520,"imageIndex":4},{"imageOffset":6606660,"symbol":"__88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_5","symbolLocation":188,"imageIndex":4},{"imageOffset":119780,"symbol":"_xpc_connection_reply_callout","symbolLocation":124,"imageIndex":2},{"imageOffset":66684,"symbol":"_xpc_connection_call_reply_async","symbolLocation":88,"imageIndex":2},{"imageOffset":16476,"symbol":"_dispatch_client_callout3","symbolLocation":20,"imageIndex":1},{"imageOffset":139096,"symbol":"_dispatch_mach_msg_async_reply_invoke","symbolLocation":344,"imageIndex":1},{"imageOffset":46444,"symbol":"_dispatch_lane_serial_drain","symbolLocation":376,"imageIndex":1},{"imageOffset":49684,"symbol":"_dispatch_lane_invoke","symbolLocation":436,"imageIndex":1},{"imageOffset":93712,"symbol":"_dispatch_workloop_worker_thread","symbolLocation":652,"imageIndex":1},{"imageOffset":3576,"symbol":"_pthread_wqthread","symbolLocation":288,"imageIndex":0},{"imageOffset":2968,"symbol":"start_wqthread","symbolLocation":8,"imageIndex":0}]},{"id":7171850,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]},{"id":7171851,"frames":[{"imageOffset":2960,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":0}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 8094875648,
    "size" : 49152,
    "uuid" : "e0674d94-1a29-36b9-a1f9-ca129f0cfc7e",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6932373504,
    "size" : 290816,
    "uuid" : "c663d847-b94f-3fb0-9254-32edbc55315e",
    "path" : "\/usr\/lib\/system\/libdispatch.dylib",
    "name" : "libdispatch.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 8095154176,
    "size" : 262144,
    "uuid" : "bf679bcd-7230-311b-a4da-1dc48d787abc",
    "path" : "\/usr\/lib\/system\/libxpc.dylib",
    "name" : "libxpc.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6810206208,
    "size" : 4083712,
    "uuid" : "42c5c917-0447-3995-b50f-de4d132c2435",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/CoreFoundation",
    "name" : "CoreFoundation"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6714015744,
    "size" : 9744384,
    "uuid" : "aa92cd58-561a-3414-92f4-b4120298b39a",
    "path" : "\/System\/Library\/Frameworks\/Foundation.framework\/Foundation",
    "name" : "Foundation"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4487462912,
    "size" : 4472832,
    "uuid" : "adc409d8-76da-3bc8-916a-002e229a9449",
    "path" : "\/private\/var\/containers\/Bundle\/Application\/119BC915-1BE0-411D-A682-BA6523133F5E\/xxxxxx.app\/Frameworks\/Instabug.framework\/Instabug",
    "name" : "Instabug"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4479860736,
    "size" : 81920,
    "uuid" : "59e57284-c820-361d-8ae0-f3241f3be390",
    "path" : "\/private\/var\/containers\/Bundle\/Application\/119BC915-1BE0-411D-A682-BA6523133F5E\/xxxxxx.app\/Frameworks\/OneSignalCore.framework\/OneSignalCore",
    "name" : "OneSignalCore"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4480450560,
    "size" : 393216,
    "uuid" : "7cbc4ca6-7669-3442-bc2d-5dad6b031c22",
    "path" : "\/private\/var\/containers\/Bundle\/Application\/119BC915-1BE0-411D-A682-BA6523133F5E\/xxxxxx.app\/Frameworks\/OneSignal.framework\/OneSignal",
    "name" : "OneSignal"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 7824093184,
    "size" : 225276,
    "uuid" : "d3eb8b56-7c22-3265-a985-a436bc8caf15",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6845390848,
    "size" : 24932352,
    "uuid" : "7b942fa4-cb76-3375-9972-f58c14492fb4",
    "path" : "\/System\/Library\/PrivateFrameworks\/UIKitCore.framework\/UIKitCore",
    "name" : "UIKitCore"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6998855680,
    "size" : 4063232,
    "uuid" : "1c7c3d6c-33e3-3cf7-9fdf-ffdd45d7d3f0",
    "path" : "\/System\/Library\/Frameworks\/CoreMotion.framework\/CoreMotion",
    "name" : "CoreMotion"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6828535808,
    "size" : 3956736,
    "uuid" : "35605de3-3723-335a-83d9-6f35f2989935",
    "path" : "\/System\/Library\/Frameworks\/CFNetwork.framework\/CFNetwork",
    "name" : "CFNetwork"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4483547136,
    "size" : 2654208,
    "uuid" : "946f9fbc-777a-3fc7-ac5a-a32556b19184",
    "path" : "\/private\/var\/containers\/Bundle\/Application\/119BC915-1BE0-411D-A682-BA6523133F5E\/xxxxxx.app\/Frameworks\/Intercom.framework\/Intercom",
    "name" : "Intercom"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6870323200,
    "size" : 25464832,
    "uuid" : "122e646e-6b17-3561-975f-c414c8dae3d3",
    "path" : "\/System\/Library\/Frameworks\/SwiftUI.framework\/SwiftUI",
    "name" : "SwiftUI"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 6695895040,
  "size" : 2891382784,
  "uuid" : "681162e4-0210-378a-a537-cf5117165b68"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=1.2G resident=0K(0%) swapped_out_or_unallocated=1.2G(100%)\nWritable regions: Total=655.3M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=655.3M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nAccelerate framework               256K        2 \nActivity Tracing                   256K        1 \nCG raster data                    4800K       55 \nColorSync                          176K       10 \nCoreAnimation                     3472K       96 \nCoreData                           128K        3 \nCoreData Object IDs               4112K        2 \nFoundation                          16K        1 \nImage IO                          5744K        6 \nKernel Alloc Once                   32K        1 \nMALLOC                           609.5M      385 \nMALLOC guard page                  192K       12 \nSQLite page cache                 2240K       35 \nSTACK GUARD                        336K       21 \nStack                             11.6M       21 \nVM_ALLOCATE                       12.4M        6 \n__AUTH                            4702K      631 \n__AUTH_CONST                      32.2M      840 \n__CTF                               756        1 \n__DATA                            19.2M      840 \n__DATA_CONST                      43.8M      845 \n__DATA_DIRTY                      3645K      686 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       377.1M       12 \n__OBJC_CONST                      8610K      595 \n__OBJC_RO                         78.1M        1 \n__OBJC_RW                         2415K        1 \n__TEXT                           852.9M      869 \ndyld private memory                256K        1 \nlibnetwork                        1664K       24 \nmapped file                      370.3M      772 \nshared memory                     9312K       10 \n===========                     =======  ======= \nTOTAL                              2.4G     6786 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "6112e3d2fc54bc3389840661",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "6349ee1ad5eaa940d3c32170"
      },
      "deploymentId" : 240000208
    },
    {
      "rolloutId" : "62868a738e8ae2385955687e",
      "factorPackIds" : {
        "SIRI_DICTATION_ASSETS" : "62868adbcec4674079196394"
      },
      "deploymentId" : 250000003
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "890ab696-fe85-42d3-98fa-10d5ee58e1ef",
      "experimentId" : "620ebc346508065773aa3ef8",
      "deploymentId" : 400000031
    },
    {
      "treatmentId" : "a2c66376-6910-4142-b340-3476dd2ce1bf",
      "experimentId" : "621923057b59736391be1571",
      "deploymentId" : 400000011
    }
  ]
}
}
yousefhamza commented 2 years ago

Hi @danniss10

This issue happens because OneSignal's swizzling implementation uses method_exchangeImplementations which will make the actual original implementation inaccessible to any other swizzling agent, like Instabug; as the only way to get it is to guess the new selector added by the swizzling agent before us which is also inaccessible.

Instead, they should use a different approach where they change the implementation of willTerminate... method without changing the _cmd, using something like method_setImplementation

This screenshot shows the final situation after OneSignal swizzles and Instabug swizzles

Screen Shot 2022-10-28 at 11 48 38 PM

This screenshot shows how it should look like

Screen Shot 2022-10-28 at 11 50 01 PM

References:

  1. Blog post: The right way to swizzle in ObjC
  2. A Story About Swizzling "the Right Way™" and Touch Forwarding
yousefhamza commented 2 years ago

An update, I have tested Instabug with OneSignal swizzling code, and I couldn't reproduce this issue.

I have tested with the following project if you wanna give it a shot: InstabugOneSignal.zip

danniss10 commented 2 years ago

Thanks for checking and for the helpful explanation @yousefhamza!

Did more digging and was actually able to narrow it down to a commit where we integrated Google Firebase into our project.

I don't understand why Firebase doesn't show up in the crash logs, but it looks like Firebase also does some swizzling which may interfere.

We were able to get the crash to stop by adding this flag to our info.plist: FirebaseAppDelegateProxyEnabled=NO. Per this post on stack overflow, it disables the swizzling.

For reference, we use firebase-ios-sdk 9.6.0 and import FirebaseRemoteConfig and FirebaseAnalytics

yousefhamza commented 2 years ago

Worth noting that OneSignal recently patched a similar crash in v3.11.2 https://github.com/OneSignal/OneSignal-iOS-SDK/pull/1100

I was able to reproduce this crash in this version of the sample project: InstabugOneSignal.zip

Explanation of the crash:

  1. Your app doesn't implement applicationWillTerminate:, so OneSignal adds its own as the implementation of applicationWillTerminate in your AppDelegate class
  2. Instabug initializes and it finds applicationWillTerminate: implementation there, we do not swizzle if it's not there, so we update the implementation to our implementation + OneSignal's implementation
  3. OneSignal swizzles again, simulated by the swizzle again button in the app, and it finds that the implementation of applicationWillTerminate is not their implementation, so they add their own implementation to oneSignalApplicationWillTerminate: and swipe the implementations of applicationWillTerminate: and oneSignalApplicationWillTerminate:

Which will end up in exactly the setup shown in the first screenshot here: https://github.com/Instabug/Instabug-SP/issues/23#issuecomment-1295510305

This scenario was happening in OneSignal via changing the app delegate; setting it to nil then re-set it to the original class again, so you may look into similar scenarios in your code as well

jkasten2 commented 2 years ago

Current Issue

@danniss10 Thanks for the extra detail on Firebase also being included and this detail:

We were able to get the crash to stop by adding this flag to our info.plist: FirebaseAppDelegateProxyEnabled=NO. Per this post on stack overflow, it disables the swizzling.

Question

@danniss10 Just to confirm what it takes to reproduce the issue?:

OneSignal Swizzling Details

@yousefhamza I am one of the devs who work on the OneSignal iOS SDK. Great diagram showing the selector to implementation mapping of how swizzling is effecting things here! It's accurate from the OneSignal side of things.

OneSignal does use method_exchangeImplementations which does change the _cmd (AKA selector), so it does leave a trace behind. While that is a pro I am not convinced that using method_setImplementation would cause less conflicts with others swizzlers.

Instabug + OneSignal Swizzling

In your second test project (InstabugOneSignal.zip) you copied in some of the OneSignal logic but you're missing a key piece where OneSignal ensures it never swizzle the same class more than once: https://github.com/OneSignal/OneSignal-iOS-SDK/blob/3.11.2/iOS_SDK/OneSignalSDK/Source/UIApplicationDelegate%2BOneSignal.m#L78

I think that is why in your first project (InstabugOneSignal.zip) you were not able to reproduce the bug since you were using the full OneSignal SDK.

Thanks

@yousefhamza Really appreciate the deep dive here on the swizzling investigation with OneSignal!

yousefhamza commented 2 years ago

Thanks for the kind words 🙏

About this

OneSignal does use method_exchangeImplementations which does change the _cmd (AKA selector), so it does leave a trace behind. While that is a pro I am not convinced that using method_setImplementation would cause less conflicts with other swizzlers.

For the current bug, if the same sequence of events still happens, using method_setImplementation OneSignal implementation will be called, then Instabug implementaiton called, then OneSignal implementation called again, and that's it.

This is far from ideal as I guess this may result in inaccurate data on your side, but arguably better than an infinite loop

henrique-eguchi commented 1 year ago

If anyone is still experiencing this, you might want to disable the Instabug crash report. I disabled it in my project because it also have Crashlytics for crash report so it's sort of convenient for us while we wait a definitive solution for this.

yousefhamza commented 1 year ago

Hi @henrique-eguchi That works because of the method in a conflict between us and OneSignal willTerminate is used in one of the features on our crash reporting called "User terminations", you can know more about it here: https://docs.instabug.com/docs/ios-reporting-crashes#user-terminations

If you still wish to use our crash reporting product, you can reach out to support to disable this feature until OneSignal can work out a solution with us 🙏