Answered

Crashing issue with iOS Intercom SDK 15.02


Userlevel 1
  • New Participant
  • 4 replies

Dear Intercom Devs,

After a new Intercom 15.0.2 SDK release, we have updated it on our end and released a new version of our app last week. Unfortunately, we started getting a new crashes from Intercom on Firebase. Here are the details of them.

  1. Crashed: nexus.reachability
    0  libobjc.A.dylib                0x3a7c objc_retain + 16
    1  libobjc.A.dylib                0x3a7c objc_retain_x0 + 16
    2  Intercom                       0x5d424 -[IntercomSDK_IntercomNexusSocket resetSocket] + 18676
    3  Intercom                       0x5d4a0 -[IntercomSDK_IntercomNexusSocket reconnect] + 18800
    4  Intercom                       0x5a5e0 -[IntercomSDK_IntercomNexusConnection reconnectSockets] + 6832
    5  Network                        0x7f2e5c __nw_path_necp_update_evaluator_block_invoke + 456
    6  libdispatch.dylib              0x2320 _dispatch_call_block_and_release + 32
    7  libdispatch.dylib              0x3eac _dispatch_client_callout + 20
    8  libdispatch.dylib              0xb534 _dispatch_lane_serial_drain + 668
    9  libdispatch.dylib              0xc0a4 _dispatch_lane_invoke + 384
    10 libdispatch.dylib              0x16cdc _dispatch_workloop_worker_thread + 648
    11 libsystem_pthread.dylib        0xddc _pthread_wqthread + 288
    12 libsystem_pthread.dylib        0xb7c start_wqthread + 8
  2. Crashed: com.apple.main-thread
    0  CoreFoundation                 0x1b1238 CFRelease.cold.1 + 16
    1  CoreFoundation                 0x7f128 CFRetain + 330
    2  CoreFoundation                 0xe35ac __CFRunLoopTimerDeallocate + 44
    3  CoreFoundation                 0x7d024 _CFRelease + 284
    4  Intercom                       0x5d434 -[IntercomSDK_IntercomNexusSocket resetSocket] + 18692
    5  Intercom                       0x5d4a0 -[IntercomSDK_IntercomNexusSocket reconnect] + 18800
    6  Foundation                     0x83330 __NSFireTimer + 96
    7  CoreFoundation                 0xcb704 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
    8  CoreFoundation                 0x8903c __CFRunLoopDoTimer + 940
    9  CoreFoundation                 0x2e7fc __CFRunLoopDoTimers + 288
    10 CoreFoundation                 0x7a5c4 __CFRunLoopRun + 1852
    11 CoreFoundation                 0x7f4dc CFRunLoopRunSpecific + 612
    12 GraphicsServices               0x135c GSEventRunModal + 164
    13 UIKitCore                      0x39d37c -[UIApplication _run] + 888
    14 UIKitCore                      0x39cfe0 UIApplicationMain + 340
    15 MyApp.                       0x8840 main + 13 (AppDelegate.swift:13)
    16 ???                            0x1b71d0dec (Missing)

Could you please take a look?

Thanks in advance!

icon

Best answer by Shauna 14 July 2023, 15:42

View original

14 replies

Userlevel 3
Badge +4

Hey @Nick 👋🏼 Shauna here from Support!

I’ve gone ahead and opened a conversation with our support team to investigate this for you. They will reach out to you as soon as they can 🔥

Giving my +1 here. I’ve also seen this crash today with version 15.0.3 after leaving the app running in the background for a long time and then coming back to it.

I have the same issue – the crashes started after we updated Intercom from 15.0.1 to 15.0.3. I wasn’t able to reproduce it yet, but the stacktrace on Crashlytics is the same as Nick’s. 

Adding my +1 here.

We recently upgraded to 15.0.3 and notice this crash in production.

We were not able to reproduce it but saw this bug growing as more users upgrade to the latest version.

Is there any update? I saw version 15.1.1 is out with

> Fixed an issue where starting a new conversation could cause a crash.

Is this related?

Userlevel 2
Badge +2

Hi folks

Looking into a fix for this now. Will post when I have an update.

Brian

Userlevel 2
Badge +2

Hi folks

This has been fixed in release 15.1.2 of the iOS SDK.

Thanks for reporting the issue here.

Brian

Hi folks

This has been fixed in release 15.1.2 of the iOS SDK.

Thanks for reporting the issue here.

Brian

 

@Brian B11 we just started rollout of a version containing that fix (15.1.3) and we’re seeing new crashes that are seemingly related:

SIGSEGV 0x000223111d67d170​​​​​​

Crashed: com.apple.NSURLSession-delegate

0  CoreFoundation                 0xaccec _CFArrayCheckAndGetValueAtIndex + 104

1  CoreFoundation                 0x30240 -[__NSCFArray objectAtIndex:] + 88

2  CoreFoundation                 0x2fd3c CFArrayGetFirstIndexOfValue + 252

3  CoreFoundation                 0x99528 CFRunLoopRemoveTimer + 200

4  CoreFoundation                 0xba6f8 CFRunLoopTimerInvalidate + 576

5  Intercom                       0x5ddcc -[IntercomSDK_IntercomNexusSocket resetConnectionTimeout] + 19880

6  Intercom                       0x5da18 -[IntercomSDK_IntercomNexusSocket handleSocketMessageReceived:] + 18932

7  Intercom                       0x5d88c __61-[IntercomSDK_IntercomNexusSocket listenForWebSocketMessages]_block_invoke + 18536

8  libdispatch.dylib              0x2320 _dispatch_call_block_and_release + 32

9  libdispatch.dylib              0x3eac _dispatch_client_callout + 20

10 libdispatch.dylib              0xb534 _dispatch_lane_serial_drain + 668

11 libdispatch.dylib              0xc0d8 _dispatch_lane_invoke + 436

12 libdispatch.dylib              0x16cdc _dispatch_workloop_worker_thread + 648

13 libsystem_pthread.dylib        0xddc _pthread_wqthread + 288

14 libsystem_pthread.dylib        0xb7c start_wqthread + 8

 

From a glance, it would seem like you’re invalidating a timer from the callback queue of a URLSession. If that’s the case, you should be able to fix it by making sure the timer is invalidated on the same thread that it is scheduled.

That being said you should probably synchronize all the side-effects that happen as a result of that URLSession callback, unless the things you’re calling are explicitly thread safe.

Hi everyone,
I wanted to chime in and saying that I’m having roughly the same issue as everyone else.

Using 15.1.4 with Firebase, as soon as I “Intercom.loginUser”, CPU usage of the app hits about 130%+ and stays that way until it crashes. Using Instruments I can see a thread with that’s hammering the CPU:

15    __61-[IntercomSDK_IntercomNexusSocket listenForWebSocketMessages]_block_invoke    
11    -[IntercomSDK_IntercomNexusSocket handleSocketMessageReceived:]    
11    -[IntercomSDK_IntercomNexusSocket resetConnectionTimeout]    
6    +[NSTimer(NSTimer) scheduledTimerWithTimeInterval:repeats:block:]    
2    -[NSTimer(NSTimer) initWithFireDate:interval:repeats:block:]    
 

Using a blank SwiftUI app without Firebase works like normal. Not sure if this helps anything but there you go!

Userlevel 1

I’m seeing similar behavior (extremely high CPU usage) when building with Xcode 15.0 Beta 7 to iOS 17.0 beta 7 on Intercom 15.1.5.

We’re having this issue too on 15.1.4:

https://social-stocks-ld.sentry.io/share/issue/28f10bcf82d14db78e2183574de570b6/

Which version is guaranteed to not have this issue? 15.0.1?

Thank you all 

Userlevel 1

Yes, 15.0.1 does not have the CPU issue and also includes the fix if you use Lottie.

Userlevel 1

This issue appears to be resolved when using Intercom 15.2.1! 🎉

Reappeared in 15.2.1

https://social-stocks-ld.sentry.io/share/issue/28f10bcf82d14db78e2183574de570b6/

We’re seeing this issue in 16.4.0 on iOS 17.2.1 and can reproduce by doing the following:

  1. Log in Intercom user
  2. Log out using Intercom.logout()
  3. Log in again

The CPU jumps to over 100% right away after the second login.

Additionally, all of our high energy usage reports in Xcode come from the Intercom SDK. There seems to be something wrong with the WebSocket implementation (we use WebSockets elsewhere in our app and do not receive high energy reports from outside of the Intercom SDK).

Reply