Answered

The error about incorrect threads using in Xcode 14


Hi! When building the application in Xcode 14.0 b6, it shows the following error:

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 743, TID: 31796
Backtrace
=================================================================
3 Intercom 0x000000010440805c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 80944
4 Intercom 0x0000000104407e48 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 80412
5 libdispatch.dylib 0x0000000103c2a04c _dispatch_client_callout + 20
6 libdispatch.dylib 0x0000000103c2bbbc _dispatch_once_callout + 136
7 Intercom 0x0000000104407de0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 80308
8 Intercom 0x0000000104403d5c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 63792
9 Intercom 0x0000000104402950 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 58660
10 Intercom 0x00000001043d5ef8 IntercomSDK_AFQueryStringPairsFromKeyAndValue + 396272
11 Intercom 0x00000001043d5e00 IntercomSDK_AFQueryStringPairsFromKeyAndValue + 396024
12 Intercom 0x00000001043d349c IntercomSDK_AFQueryStringPairsFromKeyAndValue + 385428
13 Intercom 0x00000001043d3134 IntercomSDK_AFQueryStringPairsFromKeyAndValue + 384556
14 Intercom 0x00000001043d1a6c IntercomSDK_AFQueryStringPairsFromKeyAndValue + 378724
15 Intercom 0x0000000104471908 shouldRenderOnNewLine + 49280
16 Intercom 0x0000000104471438 shouldRenderOnNewLine + 48048
17 libdispatch.dylib 0x0000000103c28598 _dispatch_call_block_and_release + 32
18 libdispatch.dylib 0x0000000103c2a04c _dispatch_client_callout + 20
19 libdispatch.dylib 0x0000000103c3e69c _dispatch_root_queue_drain + 972
20 libdispatch.dylib 0x0000000103c3ee64 _dispatch_worker_thread2 + 196
21 libsystem_pthread.dylib 0x00000001e0f5ddbc _pthread_wqthread + 228
22 libsystem_pthread.dylib 0x00000001e0f5db98 start_wqthread + 8

It does not cause a crash, but it might be useful to fix it.

 

Intercom iOS SDK v. 12.4.3

Xcode 14.0 b6

The device on iPhone 13, iOS 16 b7

icon

Best answer by mateusz.leszkiewicz 13 June 2024, 13:10

View original

22 replies

Userlevel 2

Hey @etaskun​! Daniel from Customer Support Engineering here 🔧 

 

Thanks for flagging this with us! I haven't seen an error like this before, but I know the team have made some changes relating to the main thread that runs on the newest SDK version. I'm going to bring this one up with the team to see if we can get some more insight into this one 👍 I'll let you know if there's anything you can do to resolve this!

Userlevel 2

Hey again @etaskun​! I just heard back from our mobile team - we don't currently support iOS 16, but we will be shipping support once iOS 16 is released publicly. Since these logs are just a warning, it shouldn't affect your app at all 👍

Now that iOS 16 has been officially released to the public, are you able to address the runtime warning? Thanks!

Userlevel 2

Hey @ryan z​! Yes, you can find the brand new V13.0.0 of our SDK live now on our iOS repository 🙌

Hi @daniel m15​, thanks for the update! I wanted to let you know that I am still seeing a runtime warning in V13.0.0. This is what I found in the console:

 

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 12326, TID: 28741516
Backtrace
=================================================================
3 Intercom 0x000000011d399f7f IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 83012
4 Intercom 0x000000011d399d88 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 82509
5 libdispatch.dylib 0x000000011eb83f5b _dispatch_client_callout + 8
6 libdispatch.dylib 0x000000011eb855b5 _dispatch_once_callout + 66
7 Intercom 0x000000011d399d1d IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 82402
8 Intercom 0x000000011d395a20 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 65253
9 Intercom 0x000000011d3945b1 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 60022
10 Intercom 0x000000011d367078 IntercomSDK_AFQueryStringPairsFromKeyAndValue + 412785
11 Intercom 0x000000011d366f87 IntercomSDK_AFQueryStringPairsFromKeyAndValue + 412544
12 Intercom 0x000000011d3645a7 IntercomSDK_AFQueryStringPairsFromKeyAndValue + 401824
13 Intercom 0x000000011d3641b2 IntercomSDK_AFQueryStringPairsFromKeyAndValue + 400811
14 Intercom 0x000000011d36294f IntercomSDK_AFQueryStringPairsFromKeyAndValue + 394568
15 Intercom 0x000000011d405dfc shouldRenderOnNewLine + 49311
16 Intercom 0x000000011d405928 shouldRenderOnNewLine + 48075
17 libdispatch.dylib 0x000000011eb82d18 _dispatch_call_block_and_release + 12
18 libdispatch.dylib 0x000000011eb83f5b _dispatch_client_callout + 8
19 libdispatch.dylib 0x000000011eb99118 _dispatch_root_queue_drain + 1087
20 libdispatch.dylib 0x000000011eb99b17 _dispatch_worker_thread2 + 278
21 libsystem_pthread.dylib 0x00007ff833e39f8a _pthread_wqthread + 256
22 libsystem_pthread.dylib 0x00007ff833e38f57 start_wqthread + 15

Please let me know if you are able to track it down and I'll be sure to verify any potential fixes.

We are also seeing this thread warning in Xcode 14. Even after updating to version 13.0.0 of the SDK.

I just updated to version 13 and still seeing this warning.

Hello, same problem here, even after updated to version 13 of the SDK...

Userlevel 2

Hey all 👋 I've let the team know that you're seeing runtime warnings in the newest iOS version. For no, I wouldn't worry too much if you are still able to use the app, but I'll revert back here with an update when I hear a response 👍

Userlevel 2

Hello again everyone 👋

 

I have received confirmation from our product team that this is not an issue caused by Intercom, but rather a bug in Xcode that's mistakenly triggering warnings to be printed. This is not something that we can fix at the moment. Do bear in mind that these warnings are being sent mistakenly; the performance of your app will not be affected. We hope to address this issue in the near future.

 

Have a nice day 😊

This may help in diagnosing and resolving the issue:

https://developer.apple.com/documentation/xcode/diagnosing-performance-issues-early

 

Also it looks like Realm was having the same issue and resolved it with this pull request.

@daniel m15​ 

Hey, we’re facing the same issue with Intercom SDK 13.0.0 using the stable version of Xcode 14.0.1

There are pretty lots of similar issues with other 3rd parties SDKs. Could you please gently double-check all your code for using GCD semaphores. Looks like you might have a priority inversion issue in your SDK? https://forums.swift.org/t/xcode-14-beta-thread-performance-checker/57883/p>

 

Unfortunately, we can’t check it by ourselves, because you have a compiled version of xcframework in your git repository https://github.com/intercom/intercom-ios/p>

Hello! Any update here? We're still seeing the log.

Userlevel 1

Hey Intercom Team,

We are also experiencing this warning in Xcode 14.2 including crashes on Firebase with Intercom SDK version 14.0.6 [tried with latest 14.1.0 version as well but still getting debugger warning].

We hope you guys take a look this issue and give us possible solution.

Thanks.

 

Debugger warning:

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 23927, TID: 5029197
Backtrace
=================================================================
3   Intercom                            0x000000010bc3eda0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 70348
4   Intercom                            0x000000010bc3ebb0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 69852
5   libdispatch.dylib                   0x000000010b315ff0 _dispatch_client_callout + 20
6   libdispatch.dylib                   0x000000010b317b60 _dispatch_once_callout + 136
7   Intercom                            0x000000010bc3eb60 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 69772
8   Intercom                            0x000000010bc3b3f0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 55580
9   Intercom                            0x000000010bc3a2e4 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 51216
10  Intercom                            0x000000010bc13868 IntercomSDK_MethodSwizzle + 15788
11  Intercom                            0x000000010bc137a8 IntercomSDK_MethodSwizzle + 15596
12  Intercom                            0x000000010bc11440 IntercomSDK_MethodSwizzle + 6532
13  Intercom                            0x000000010bc0fde4 IntercomSDK_MethodSwizzle + 808
14  Intercom                            0x000000010bc966bc shouldRenderOnNewLine + 41536
15  Intercom                            0x000000010bc9635c shouldRenderOnNewLine + 40672
16  libdispatch.dylib                   0x000000010b31453c _dispatch_call_block_and_release + 32
17  libdispatch.dylib                   0x000000010b315ff0 _dispatch_client_callout + 20
18  libdispatch.dylib                   0x000000010b32a69c _dispatch_root_queue_drain + 972
19  libdispatch.dylib                   0x000000010b32ae64 _dispatch_worker_thread2 + 196
20  libsystem_pthread.dylib             0x0000000202eb8dbc _pthread_wqthread + 228
21  libsystem_pthread.dylib             0x0000000202eb8b98 start_wqthread + 8

 

Firebase crash log:

Crashed: com.apple.NSURLSession-delegate
0  libobjc.A.dylib                0x4174 objc_release + 16
1  libobjc.A.dylib                0x4174 objc_release_x0 + 16
2  Intercom                       0x122d94 shouldRenderOnNewLine + 316752
3  Intercom                       0xb7f6c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 259656
4  Intercom                       0xb7e6c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 259400
5  Intercom                       0xb009c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 227192
6  Intercom                       0xaa4e0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 203708
7  Intercom                       0xd3be0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 373436
8  Intercom                       0xd3760 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 372284
9  FirebasePerformance            0x19be4 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke_2 + 307 (FPRNSURLSessionInstrument.m:307)
10 FirebasePerformance            0x19be4 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke_2 + 307 (FPRNSURLSessionInstrument.m:307)
11 CFNetwork                      0x1f97c CFURLRequestSetMainDocumentURL + 2972
12 CFNetwork                      0x2f664 _CFNetworkErrorCopyLocalizedDescriptionWithHostname + 13648
13 libdispatch.dylib              0x2320 _dispatch_call_block_and_release + 32
14 libdispatch.dylib              0x3eac _dispatch_client_callout + 20
15 libdispatch.dylib              0xb534 _dispatch_lane_serial_drain + 668
16 libdispatch.dylib              0xc0d8 _dispatch_lane_invoke + 436
17 libdispatch.dylib              0x16cdc _dispatch_workloop_worker_thread + 648
18 libsystem_pthread.dylib        0xddc _pthread_wqthread + 288
19 libsystem_pthread.dylib        0xb7c start_wqthread + 8

Userlevel 1

Dear Intercom Team,

In addition to my prev post, I want to add another crash log to help you guys investigate the problem:

Crashed: com.apple.NSURLSession-delegate
0  CoreFoundation                 0x30f4 -[__NSCFString isEqualToString:] + 176
1  Intercom                       0x122a60 shouldRenderOnNewLine + 315932

2  Intercom                       0xb7f6c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 259656
3  Intercom                       0xb7e6c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 259400
4  Intercom                       0xb009c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 227192
5  Intercom                       0xaa4e0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 203708
6  Intercom                       0xd3be0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 373436
7  Intercom                       0xd3760 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 372284
8  FirebasePerformance            0x19be4 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke_2 + 307 (FPRNSURLSessionInstrument.m:307)
9  FirebasePerformance            0x19be4 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke_2 + 307 (FPRNSURLSessionInstrument.m:307)
10 CFNetwork                      0x1f97c CFURLRequestSetMainDocumentURL + 2972
11 CFNetwork                      0x2f664 _CFNetworkErrorCopyLocalizedDescriptionWithHostname + 13648
12 libdispatch.dylib              0x2320 _dispatch_call_block_and_release + 32
13 libdispatch.dylib              0x3eac _dispatch_client_callout + 20
14 libdispatch.dylib              0xb534 _dispatch_lane_serial_drain + 668
15 libdispatch.dylib              0xc0d8 _dispatch_lane_invoke + 436
16 libdispatch.dylib              0x16cdc _dispatch_workloop_worker_thread + 648
17 libsystem_pthread.dylib        0xddc _pthread_wqthread + 288
18 libsystem_pthread.dylib        0xb7c start_wqthread + 8

Getting a crash as well.  Latest Xcode (14.3) and latest Intercom SDK (14.1.0).

 

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 9790, TID: 1254070
Backtrace
=================================================================
3 Intercom 0x000000010339eda0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 70348
4 Intercom 0x000000010339ebb0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 69852
5 libdispatch.dylib 0x0000000102e92038 _dispatch_client_callout + 20
6 libdispatch.dylib 0x0000000102e93b9c _dispatch_once_callout + 140
7 Intercom 0x000000010339eb60 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 69772
8 Intercom 0x000000010339b3f0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 55580
9 Intercom 0x000000010339a2e4 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 51216
10 Intercom 0x0000000103373868 IntercomSDK_MethodSwizzle + 15788
11 Intercom 0x00000001033737a8 IntercomSDK_MethodSwizzle + 15596
12 Intercom 0x0000000103371440 IntercomSDK_MethodSwizzle + 6532
13 Intercom 0x000000010336fde4 IntercomSDK_MethodSwizzle + 808
14 Intercom 0x00000001033f66bc shouldRenderOnNewLine + 41536
15 Intercom 0x00000001033f635c shouldRenderOnNewLine + 40672
16 libdispatch.dylib 0x0000000102e90520 _dispatch_call_block_and_release + 32
17 libdispatch.dylib 0x0000000102e92038 _dispatch_client_callout + 20
18 libdispatch.dylib 0x0000000102ea6670 _dispatch_root_queue_drain + 972
19 libdispatch.dylib 0x0000000102ea6e34 _dispatch_worker_thread2 + 196
20 libsystem_pthread.dylib 0x00000001ebe77da0 _pthread_wqthread + 228
21 libsystem_pthread.dylib 0x00000001ebe77b7c start_wqthread + 8

 

@Daniel M15 I have to agree with @Anton B that it looks like your SDK is having priority inversion issues.  The latest version of Xcode are actually doing a better job of calling out the issues like this instead of mostly ignoring them as in the past.

This is the notice I get (see my post above for Backtrace):

Thread Performance Checker: Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions.

Could you have your dev team take another look at the issue?  Thanks. 

I also have this problem. Intercom 14.0.4 and Xcode 14.2.
Run into it while investigating a problem with attributes for some of our users not being updated on Intercom.loginUser(with: userAttributes). No evidences these two can be related, but this thread inversion issue is the only problem with Intercom I can suspect at the moment.

We also have this crash happening in our app.  
It is our top most crash (more than 75% of our crashes)

Did this ever get resolved? I’m getting these issues after upgrading our XCode and react native version to 0.72. 

 

Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x7578 __pthread_kill + 8
1 libsystem_pthread.dylib 0x7118 pthread_kill + 268
2 libsystem_c.dylib 0x1d178 abort + 180
3 libswiftCore.dylib 0x3b8b98 swift::fatalError(unsigned int, char const*, ...) + 134
4 libswiftCore.dylib 0x3b8bb8 swift::warningv(unsigned int, char const*, char*) + 30
5 libswiftCore.dylib 0x3b8d5c swift::swift_abortRetainUnowned(void const*) + 36
6 libswiftCore.dylib 0x403d94 swift_unknownObjectUnownedTakeStrong + 74
7 Intercom 0x379784 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 1979528
8 Intercom 0x3776b0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 1971124
9 Foundation 0x83180 __NSFireTimer + 96
10 CoreFoundation 0xcb624 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
11 CoreFoundation 0x88f4c __CFRunLoopDoTimer + 940
12 CoreFoundation 0x2e71c __CFRunLoopDoTimers + 288
13 CoreFoundation 0x7a4d4 __CFRunLoopRun + 1852
14 CoreFoundation 0x7f3ec CFRunLoopRunSpecific + 612
15 GraphicsServices 0x135c GSEventRunModal + 164
16 UIKitCore 0x39cf58 -[UIApplication _run] + 888
17 UIKitCore 0x39cbbc UIApplicationMain + 340
18 LocateALocum 0x8304 main + 7 (main.m:7)
19 ??? 0x1afb10dec (Missing)

 

I’m also seeing this issue in Xcode 15.3. I previously saw it in Xcode 14.

I am concerned there is a genuine priority inversion. 

Podfile: Intercom 5.1.10

 

Thread Performance Checker: Thread running at User-initiated quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions
PID: 30978, TID: 4531113
Backtrace
=================================================================
3 BuildupStaging 0x0000000102de5b7f -[IntercomSDK__SRRunLoopThread runLoop] + 32
4 BuildupStaging 0x0000000102de597d __67+[NSRunLoop(IntercomSDK_SRWebSocket) IntercomSDK_SR_networkRunLoop]_block_invoke + 121
5 libdispatch.dylib 0x000000010642358f _dispatch_client_callout + 8
6 libdispatch.dylib 0x0000000106424c6d _dispatch_once_callout + 66
7 BuildupStaging 0x0000000102de5901 +[NSRunLoop(IntercomSDK_SRWebSocket) IntercomSDK_SR_networkRunLoop] + 45
8 BuildupStaging 0x0000000102de0a42 -[IntercomSDK_SRWebSocket openConnection] + 80
9 BuildupStaging 0x0000000102ddf3d6 -[IntercomSDK_SRWebSocket open] + 201
10 BuildupStaging 0x0000000102cfe628 -[IntercomSDK_IntercomNexusSocket createWebsocket] + 262
11 BuildupStaging 0x0000000102cfe4f6 -[IntercomSDK_IntercomNexusSocket initWithURL:timeout:delegate:] + 261
12 BuildupStaging 0x0000000102cfbb59 -[IntercomSDK_IntercomNexusConnection createWebsockets] + 517
13 BuildupStaging 0x0000000102cfb74d -[IntercomSDK_IntercomNexusConnection setConfiguration:] + 200
14 BuildupStaging 0x0000000102cf9d1b -[IntercomSDK_IntercomNexusClient setConfiguration:] + 154
15 BuildupStaging 0x0000000102d187ab +[ICMHTTPBridge handleRealtimeConfig:] + 331
16 BuildupStaging 0x0000000102d183af __36+[ICMHTTPBridge handleBaseResponse:]_block_invoke + 62
17 libdispatch.dylib 0x000000010642229d _dispatch_call_block_and_release + 12
18 libdispatch.dylib 0x000000010642358f _dispatch_client_callout + 8
19 libdispatch.dylib 0x000000010643767f _dispatch_root_queue_drain + 1047
20 libdispatch.dylib 0x0000000106437f9d _dispatch_worker_thread2 + 277
21 libsystem_pthread.dylib 0x0000000105f01b43 _pthread_wqthread + 262
22 libsystem_pthread.dylib 0x0000000105f00acf start_wqthread + 15

 

Userlevel 3
Badge +4

HI there, It’s Mat from the Support Engineering Team 😀

Can you update your SDKs to the latest version 17.1.1 and check if that does the trick?

If it does not, please reach out to us via Messenger in your workspaces to flag this issue to our engineers.

Reply