v3rm0n / intercom_flutter

Flutter wrapper for Intercom libraries
94 stars 140 forks source link

Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 when calling sendTokenToIntercom #184

Open acoutts opened 2 years ago

acoutts commented 2 years ago

Using intercom_flutter: ^5.0.0, this came as a crash report from a user so I'm unable to reproduce and confirm if it's happening in the latest version of the plugin, but it does reference line 129 in IntercomFlutterPlugin.m as the problem spot.

One hint, I know the app was calling sendTokenToIntercom and in this particular instance the app was unable to get a token from FCM, so it would be calling this with an empty string token. I think the plugin should also safely handle empty string tokens (as it does for null values).

Crashed: com.apple.main-thread
0  Intercom                       0xeafbc shouldRenderOnNewLine + 592316
1  Intercom                       0xeb070 shouldRenderOnNewLine + 592496
2  Intercom                       0x175fc (Missing)
3  Intercom                       0x361f8 (Missing)
4  Runner                         0x2c891ac -[IntercomFlutterPlugin handleMethodCall:result:] + 129 (IntercomFlutterPlugin.m:129)
5  Flutter                        0x4ecdc0 (Missing)
6  Flutter                        0x3ff34 (Missing)
7  Flutter                        0x348db4 (Missing)
8  Flutter                        0x2ee068 (Missing)
9  Flutter                        0x2f1098 (Missing)
10 CoreFoundation                 0xae268 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
11 CoreFoundation                 0x32c40 __CFRunLoopDoTimer + 1076
12 CoreFoundation                 0x2d43c __CFRunLoopDoTimers + 328
13 CoreFoundation                 0xbc58 __CFRunLoopRun + 1944
14 CoreFoundation                 0x1f3b8 CFRunLoopRunSpecific + 600
15 GraphicsServices               0x138c GSEventRunModal + 164
16 UIKitCore                      0x5196a8 -[UIApplication _run] + 1100
17 UIKitCore                      0x2987f4 UIApplicationMain + 2092
18 Runner                         0x6400 main + 7 (AppDelegate.swift:7)
19 ???                            0x1045f9a24 (Missing)
acoutts commented 2 years ago

Actually this is an iOS device so the app was never actually calling registerFcmTokenIntercom.