realm-swift icon indicating copy to clipboard operation
realm-swift copied to clipboard

Hang risk - thread priority inversion warning (Xcode)

Open sonisan opened this issue 2 years ago • 46 comments

How frequently does the bug occur?

All the time

Description

Currently, I am working on an iOS 16.0 app (SwiftUI) with Xcode 14.0 beta 4 and RealmSwift 10.28.3.

I am on a simple use case where I want to let users create lists, which are synced to their account with Realm Sync. I followed the quickstart on SwiftUI guide to manage the authentication flow. In my models, I have a “NeoList” and “NeoListGroup” that has a List<NeoList> property (so similar to items/itemsGroup in the guide).

When adding an item to the List, Xcode triggers a warning from the Thread Performance Checker. Despite the warning, the code is working as intended.

Stacktrace & log output

Thread Performance Checker: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
PID: 1494, TID: 18792
Backtrace
=================================================================
3   List Creator                        0x00000001056410b0 _ZN5realm4util14SemaphoreMutex4lockEv + 32
4   List Creator                        0x0000000104e9abf8 _ZNSt3__111unique_lockIN5realm4util14SemaphoreMutexEEC2ERS3_ + 60
5   List Creator                        0x0000000104e9ab78 _ZNSt3__111unique_lockIN5realm4util14SemaphoreMutexEEC1ERS3_ + 36
6   List Creator                        0x0000000104e8dd0c _ZN5realm4util17InterprocessMutex4lockEv + 48
7   List Creator                        0x0000000104e8c364 _ZN5realm2DB14do_begin_writeEv + 80
8   List Creator                        0x0000000104e90860 _ZN5realm2DB17AsyncCommitHelper20blocking_begin_writeEv + 288
9   List Creator                        0x0000000104e90724 _ZN5realm2DB29do_begin_possibly_async_writeEv + 56
10  List Creator                        0x00000001055c349c _ZN5realm11Transaction18acquire_write_lockEv + 116
11  List Creator                        0x00000001050a9104 _ZN5realm11Transaction16promote_to_writeIN12_GLOBAL__N_122KVOTransactLogObserverEEEbPT_b + 228
12  List Creator                        0x00000001050a8d10 _ZZN5realm5_impl11transaction5beginERKNSt3__110shared_ptrINS_11TransactionEEEPNS_14BindingContextERNS0_15NotifierPackageEENK3$_2clIJPN12_GLOBAL__N_122KVOTransactLogObserverEEEEDaDpOT_ + 68
13  List Creator                        0x0000000105093ff4 _ZN12_GLOBAL__N_126advance_with_notificationsIZN5realm5_impl11transaction5beginERKNSt3__110shared_ptrINS1_11TransactionEEEPNS1_14BindingContextERNS2_15NotifierPackageEE3$_2EEvSB_S9_OT_SD_ + 764
14  List Creator                        0x0000000105093cec _ZN5realm5_impl11transaction5beginERKNSt3__110shared_ptrINS_11TransactionEEEPNS_14BindingContextERNS0_15NotifierPackageE + 52
15  List Creator                        0x0000000105063f24 _ZN5realm5_impl16RealmCoordinator16promote_to_writeERNS_5RealmE + 236
16  List Creator                        0x0000000105194e64 _ZN5realm5Realm20do_begin_transactionEv + 56
17  List Creator                        0x000000010519662c _ZN5realm5Realm17begin_transactionEv + 260
18  List Creator                        0x0000000104c3647c -[RLMRealm beginWriteTransactionWithError:] + 40
19  List Creator                        0x0000000104c36448 -[RLMRealm beginWriteTransaction] + 36
20  List Creator                        0x0000000104d80a3c $s10RealmSwift0A0V10beginWriteyyF + 48
21  List Creator                        0x0000000104d807a8 $s10RealmSwift0A0V5write16withoutNotifying_xSaySo20RLMNotificationTokenCG_xyKXEtKlF + 268
22  List Creator                        0x0000000104da0378 $s10RealmSwift9safeWrite33_06F2B43D1E2DA64D3C5AC1DADA9F5BA7LLyyx_yxXEtAA14ThreadConfinedRzlF + 1024
23  List Creator                        0x0000000104dafcb8 $s10RealmSwift15BoundCollectionPAASo13RLMObjectBaseC7ElementRczAA14ThreadConfinedAGRQAA4ListCyAGG5ValueRtzrlE6appendyyAGF + 1508
24  List Creator                        0x000000010495c318 $s12List_Creator03AddA4ViewV4bodyQrvg7SwiftUI05TupleD0VyAE9TextFieldVyAE0I0VG_AE6ToggleVyAKGAE6ButtonVyAKGArE10AsyncImageVyAE0N0VGSgtGyXEfU_yycfU0_ + 1084
25  SwiftUI                             0x000000010d204ed4 OUTLINED_FUNCTION_39 + 3916
26  SwiftUI                             0x000000010d1b632c OUTLINED_FUNCTION_30 + 4452
27  SwiftUI                             0x000000010d11716c OUTLINED_FUNCTION_86 + 6436
28  SwiftUI                             0x000000010d2b2710 OUTLINED_FUNCTION_6 + 11616
29  SwiftUI                             0x000000010d2b430c OUTLINED_FUNCTION_6 + 18780
30  UIKitCore                           0x00000001092ac150 -[UICollectionView _selectItemAtIndexPath:animated:scrollPosition:notifyDelegate:deselectPrevious:performCustomSelectionAction:] + 1056
31  UIKitCore                           0x00000001092d6f24 -[UICollectionView touchesEnded:withEvent:] + 476
32  UIKitCore                           0x0000000109ac8714 forwardTouchMethod + 264
33  UIKitCore                           0x0000000109ac8714 forwardTouchMethod + 264
34  UIKitCore                           0x0000000109ac8714 forwardTouchMethod + 264
35  UIKitCore                           0x000000010965289c _UIGestureEnvironmentUpdate + 5876
36  UIKitCore                           0x0000000109650ec8 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 276
37  UIKitCore                           0x0000000109650c44 -[UIGestureEnvironment _updateForEvent:window:] + 156
38  UIKitCore                           0x0000000109ad76b8 -[UIWindow sendEvent:] + 3168
39  UIKitCore                           0x0000000109ab58ac -[UIApplication sendEvent:] + 692
40  UIKitCore                           0x0000000109b314ac __dispatchPreprocessedEventFromEventQueue + 6824
41  UIKitCore                           0x0000000109b33110 __processEventQueue + 5612
42  UIKitCore                           0x0000000109b2c0b0 __eventFetcherSourceCallback + 220
43  CoreFoundation                      0x00000001803719b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
44  CoreFoundation                      0x0000000180371900 __CFRunLoopDoSource0 + 172
45  CoreFoundation                      0x0000000180371070 __CFRunLoopDoSources0 + 232
46  CoreFoundation                      0x000000018036b7b0 __CFRunLoopRun + 756
47  CoreFoundation                      0x000000018036b0a4 CFRunLoopRunSpecific + 584
48  GraphicsServices                    0x00000001892dcc8c GSEventRunModal + 160
49  UIKitCore                           0x0000000109a9be80 -[UIApplication _run] + 868
50  UIKitCore                           0x0000000109a9fe28 UIApplicationMain + 124
51  SwiftUI                             0x000000010d6effdc OUTLINED_FUNCTION_51 + 496
52  SwiftUI                             0x000000010d6efe84 OUTLINED_FUNCTION_51 + 152
53  SwiftUI                             0x000000010cee44c4 OUTLINED_FUNCTION_6 + 92
54  List Creator                        0x0000000104930f58 $s12List_Creator0a1_B3AppV5$mainyyFZ + 40
55  List Creator                        0x0000000104931000 main + 12

Can you reproduce the bug?

Yes, always

Reproduction Steps

Create a first view displaying the items in the list:

var body: some View {
		
		NavigationStack(path: $navigationPath) {
			VStack {
				List {
					ForEach(neoListGroup.items) { item in
						Text(item.title)
					}
				}
				.navigationDestination(for: NeoListGroup.self) { group in
					AddListView(group: group)
				}
			}
			.toolbar {
				ToolbarItem(placement: .navigationBarTrailing) {
					Button(action: {
						navigationPath.append(neoListGroup)
					}, label:  {Image(systemName: "plus")})
				}
			}
			.navigationTitle("My Lists")
		}
    }

The + button will lead to a second view where a new item can be appended to the list:

struct AddListView: View {
		
	@ObservedRealmObject var group: NeoListGroup
	@State var title = "Title"
	
    var body: some View {
		VStack {
			TextField("Title", text: $title)
			Button("Send") {
				$group.items.append(NeoList(title: self.title))
			}
		}
    }
}

The warning triggers exactly when hitting the button Send.

Version

10.28.3

What SDK flavour are you using?

MongoDB Realm (i.e. Sync, auth, functions)

Are you using encryption?

No, not using encryption

Platform OS and version(s)

macOS 12.5

Build environment

Xcode version: Xcode 14 (beta 4) Dependency manager and version: Realm 10.28.3, RealmDatabase 12.3.0

sonisan avatar Aug 04 '22 01:08 sonisan

I have seen this too during [RLMRealm dealloc].

Backtrace
=================================================================
Thread 9 Queue : RPAC issue generation queue (serial)
#0	0x00000001ca004d08 in os_log_fault_default_callback ()
#1	0x00000001c9ffb30c in _os_log_impl_flatten_and_send ()
#2	0x00000001c9ff81bc in _os_log ()
#3	0x00000001ca000168 in _os_log_fault_impl ()
#4	0x000000010021a098 in culledOsLogFault ()
#5	0x000000010021b1a8 in __generateCulledBacktrace_block_invoke_2 ()
#6	0x00000001005bc614 in _dispatch_call_block_and_release ()
#7	0x00000001005be0c8 in _dispatch_client_callout ()
#8	0x00000001005c6178 in _dispatch_lane_serial_drain ()
#9	0x00000001005c6ea0 in _dispatch_lane_invoke ()
#10	0x00000001005d3cbc in _dispatch_workloop_worker_thread ()
#11	0x0000000234184df8 in _pthread_wqthread ()
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0	0x00000001005c2db8 in dispatch_async ()
#1	0x000000010021a648 in generateCulledBacktrace ()
#2	0x000000010021c950 in qosWaiterSignallerInvariantCheck ()
#3	0x0000000100219c4c in interposed_dispatch_semaphore_wait ()
#4	0x000000010ee6a480 in realm::util::SemaphoreMutex::lock() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/util/interprocess_mutex.cpp:44
#5	0x000000010e4cfa5c in std::__1::unique_lock<realm::util::SemaphoreMutex>::unique_lock(realm::util::SemaphoreMutex&) at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__mutex_base:118
#6	0x000000010e4cf9bc in std::__1::unique_lock<realm::util::SemaphoreMutex>::unique_lock(realm::util::SemaphoreMutex&) at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__mutex_base:118
#7	0x000000010e4bf64c in realm::util::InterprocessMutex::lock() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/util/interprocess_mutex.hpp:328
#8	0x000000010e4bca14 in std::__1::unique_lock<realm::util::InterprocessMutex>::lock() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__mutex_base:205
#9	0x000000010e4bc6cc in realm::DB::close_internal(std::__1::unique_lock<realm::util::InterprocessMutex>, bool) at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/db.cpp:1465
#10	0x000000010e4ba34c in realm::DB::close(bool) at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/db.cpp:1445
#11	0x000000010e4bbc5c in realm::DB::~DB() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/db.cpp:1407
#12	0x000000010e4da600 in (anonymous namespace)::DBInit::~DBInit() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/db.cpp:2492
#13	0x000000010e4da5d4 in (anonymous namespace)::DBInit::~DBInit() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/db.cpp:2492
#14	0x000000010e4d8288 in std::__1::__shared_ptr_emplace<(anonymous namespace)::DBInit, std::__1::allocator<(anonymous namespace)::DBInit> >::__on_zero_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:315
#15	0x000000010e4c6384 in std::__1::__shared_count::__release_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:177
#16	0x000000010e4c62ec in std::__1::__shared_weak_count::__release_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:219
#17	0x000000010e4d6094 in std::__1::shared_ptr<realm::DB>::~shared_ptr() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:959
#18	0x000000010e4c1184 in std::__1::shared_ptr<realm::DB>::~shared_ptr() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:957
#19	0x000000010e708878 in realm::_impl::RealmCoordinator::~RealmCoordinator() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/realm_coordinator.cpp:650
#20	0x000000010e708d64 in realm::_impl::RealmCoordinator::~RealmCoordinator() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/realm_coordinator.cpp:628
#21	0x000000010e72b138 in std::__1::__shared_ptr_emplace<realm::_impl::RealmCoordinator, std::__1::allocator<realm::_impl::RealmCoordinator> >::__on_zero_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:315
#22	0x000000010e216054 in std::__1::__shared_count::__release_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:177
#23	0x000000010e215fbc in std::__1::__shared_weak_count::__release_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:219
#24	0x000000010e216984 in std::__1::shared_ptr<realm::_impl::RealmCoordinator>::~shared_ptr() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:959
#25	0x000000010e215300 in std::__1::shared_ptr<realm::_impl::RealmCoordinator>::~shared_ptr() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:957
#26	0x000000010e886be0 in realm::Realm::~Realm() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/object-store/shared_realm.cpp:104
#27	0x000000010e886fa0 in realm::Realm::~Realm() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/object-store/shared_realm.cpp:94
#28	0x000000010e71098c in std::__1::__shared_ptr_emplace<realm::Realm, std::__1::allocator<realm::Realm> >::__on_zero_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:315
#29	0x000000010df2dc78 in std::__1::__shared_count::__release_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:177
#30	0x000000010df2dbe0 in std::__1::__shared_weak_count::__release_shared() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:219
#31	0x000000010df2db94 in std::__1::shared_ptr<realm::Realm>::~shared_ptr() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:959
#32	0x000000010df26688 in std::__1::shared_ptr<realm::Realm>::~shared_ptr() at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:957
#33	0x000000010e21389c in -[RLMRealm .cxx_destruct] at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-cocoa/Realm/RLMRealm.mm:156
#34	0x00000001aa1254a4 in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#35	0x00000001aa12a21c in objc_destructInstance ()
#36	0x00000001aa1339d0 in _objc_rootDealloc ()
#37	0x000000010e21000c in -[RLMRealm dealloc] at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-cocoa/Realm/RLMRealm.mm:955

rowungiles avatar Aug 05 '22 14:08 rowungiles

It may be helpful to include your two models NeoListGroup and NeoList in the question.

Jaycyn avatar Aug 05 '22 18:08 Jaycyn

➤ Jay commented:

It may be helpful to include your two models NeoListGroup and NeoList in the question.

sync-by-unito[bot] avatar Aug 05 '22 19:08 sync-by-unito[bot]

The models are simple:

final class NeoListGroup: Object, ObjectKeyIdentifiable {
	
	@Persisted(primaryKey: true) var _id: ObjectId
	@Persisted var items = RealmSwift.List<NeoList>()
}
final class NeoList: Object, ObjectKeyIdentifiable {
	@Persisted(primaryKey: true) var _id: ObjectId
	@Persisted var title: String
}

sonisan avatar Aug 06 '22 00:08 sonisan

I inspected the code. This here is the problem.

#4 0x000000010ee6a480 in realm::util::SemaphoreMutex::lock() at /App-dzqglbowxqddcycrkrrcjykvejsi/SourcePackages/checkouts/realm-core/src/realm/util/interprocess_mutex.cpp:44

Looking at the code, Realm seems to implement mutexes with dispatch semaphores. Since a semaphore doesn't know who will unblock it (i.e., what the priority of the signaling thread will be), there's always a possibility of priority inversions. And that's what's happening here.

Why isn't Realm implementing a mutex with, say, an OS unfair lock, which doesn't suffer from that problem ? The system is perfectly capable of boosting the priority of the lock holder with OS unfair lock (or even a pthread mutex).

hamzasohail avatar Aug 11 '22 01:08 hamzasohail

Well this same issue has stopped my app's release cold. Is there any workaround?

aehlke avatar Oct 02 '22 17:10 aehlke

This is something we need to fix, but it's just a warning and not something which blocks your app from working.

tgoyne avatar Oct 03 '22 15:10 tgoyne

ok thanks, it was a symptom of a different issue I think (an issue during data migration possibly)

aehlke avatar Oct 07 '22 18:10 aehlke

I'm seeing this happen all the time too running with Realm Swift SDK 10.34.0 as of today and Xcode 14.2 on iOS 16.2.

I tried moving the realm write to a background thread and a serial queue run loop but it still did not avoid this warning.

drmarkpowell avatar Jan 17 '23 21:01 drmarkpowell

I am also seeing this issue. Has anyone managed a workaround?

ecoots avatar Feb 15 '23 15:02 ecoots

I am getting this issue too.

oscarlolero avatar Feb 17 '23 17:02 oscarlolero

I'm also facing this issue. Is there any solution to this?

Sharf8351 avatar Feb 19 '23 17:02 Sharf8351

I have same issue but It is not related to this library, It occurred in RCTSRWebSocket.m from ReactCore:

Screenshot 2023-02-20 at 11 44 45 AM

iWaleedibrahim avatar Feb 20 '23 08:02 iWaleedibrahim

same problem

pe-johndpope avatar Mar 22 '23 09:03 pe-johndpope

I have same issue but It is not related to this library, It occurred in RCTSRWebSocket.m from ReactCore:

Screenshot 2023-02-20 at 11 44 45 AM

Hi 👋 . I am getting this same hang risk warning in RCTSRWebSocket.m. Were you able to find a fix for this ? 🙏

okiki-lawrence avatar Mar 28 '23 07:03 okiki-lawrence

Hi, same error when updating react-native-webview to 12.0.2 in react-native-pell-rich-editor library

Thread Performance Checker: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions PID: 20761, TID: 6388433 Backtrace

3 examples 0x0000000102d90408 -[_RCTSRRunLoopThread runLoop] + 44 4 examples 0x0000000102d90138 __49+[NSRunLoop(RCTSRWebSocket) RCTSR_networkRunLoop]_block_invoke + 116 5 libdispatch.dylib 0x0000000107c8dd5c _dispatch_client_callout + 16 6 libdispatch.dylib 0x0000000107c8f800 _dispatch_once_callout + 80 7 examples 0x0000000102d9009c +[NSRunLoop(RCTSRWebSocket) RCTSR_networkRunLoop] + 84 8 examples 0x0000000102d8a0d8 -[RCTSRWebSocket _connect] + 68 9 examples 0x0000000102d88e7c -[RCTSRWebSocket open] + 300 10 examples 0x0000000102d6b804 -[RCTReconnectingWebSocket start] + 148 11 examples 0x0000000102d5b244 -[RCTPackagerConnection init] + 404 12 examples 0x0000000102d5b090 __49+[RCTPackagerConnection sharedPackagerConnection]_block_invoke + 36 13 libdispatch.dylib 0x0000000107c8dd5c _dispatch_client_callout + 16 14 libdispatch.dylib 0x0000000107c8f800 _dispatch_once_callout + 80 15 examples 0x0000000102d5b044 +[RCTPackagerConnection sharedPackagerConnection] + 84 16 examples 0x0000000102df4cfc -[RCTDevSettings initialize] + 148 17 examples 0x0000000103494f70 -[RCTTurboModuleManager _createAndSetUpRCTTurboModule:moduleName:moduleId:] + 2024 18 examples 0x000000010349462c __75-[RCTTurboModuleManager _provideRCTTurboModule:moduleHolder:shouldPerfLog:]_block_invoke + 136 19 examples 0x00000001034941f4 -[RCTTurboModuleManager _provideRCTTurboModule:moduleHolder:shouldPerfLog:] + 1112 20 examples 0x0000000103493cb8 -[RCTTurboModuleManager provideRCTTurboModule:] + 320 21 examples 0x000000010349593c -[RCTTurboModuleManager moduleForName:warnOnLookupFailure:] + 80 22 examples 0x0000000102cdeeec -[RCTCxxBridge moduleForName:lazilyLoadIfNecessary:] + 240 23 examples 0x0000000102cdf534 -[RCTCxxBridge moduleForClass:] + 76 24 examples 0x0000000102df81e4 -[RCTBridge(RCTDevSettings) devSettings] + 92 25 examples 0x0000000102ce3be4 -[RCTCxxBridge executeSourceCode:sync:] + 448 26 examples 0x0000000102cddf38 __21-[RCTCxxBridge start]_block_invoke.115 + 140 27 libdispatch.dylib 0x0000000107c8c594 _dispatch_call_block_and_release + 24 28 libdispatch.dylib 0x0000000107c8dd5c _dispatch_client_callout + 16 29 libdispatch.dylib 0x0000000107ca2ae8 _dispatch_root_queue_drain + 1012 30 libdispatch.dylib 0x0000000107ca353c _dispatch_worker_thread2 + 248 31 libsystem_pthread.dylib 0x00000001b0598b04 _pthread_wqthread + 224 32 libsystem_pthread.dylib 0x00000001b0597904 start_wqthread + 8

incode-mike-bytenko avatar Apr 13 '23 07:04 incode-mike-bytenko

So ... what's the fix?

AndreasGratz avatar Apr 17 '23 19:04 AndreasGratz

Having the same issue: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions.

trevyd23 avatar Apr 17 '23 23:04 trevyd23

Hi ! Same runtime issue for me

Catnais88 avatar Apr 19 '23 12:04 Catnais88

did anyone find a fix?

avimone avatar Apr 23 '23 09:04 avimone

Same problem. Any fix?

westofpluto avatar Apr 27 '23 00:04 westofpluto

Same warning here!

bluepixeltech avatar Apr 29 '23 19:04 bluepixeltech

same here! running xcode 14.3

Devorasolomon avatar May 02 '23 06:05 Devorasolomon

same, how to fixed it

chukiatt avatar May 03 '23 08:05 chukiatt

same here

Viscky avatar May 04 '23 16:05 Viscky

same here

anshif10 avatar May 05 '23 06:05 anshif10

Hi guys. Spent several hours yesterday and solved it somehow. I tried many things, so I don't remember which one exactly solves the problem (ping me, if the solution below won't help).

Start here: https://developer.apple.com/documentation/xcode/diagnosing-performance-issues-early (i put the whole link, so you see, that it's Apple and not a scam). What you need to do is go to Product > Scheme > Edit Scheme to display the scheme editor. Select the Run schemes, navigate to the Diagnostics section, and unselect the Thread Performance Checker tool checkbox.

Viscky avatar May 05 '23 22:05 Viscky

Xcode needs more resources to run your app. Close some of the services and kill any unnecessary port running on your system. Try to build the app again. This is temporary workaround. Try @Viscky s solution if you are still facing the issue.

mustkem avatar May 21 '23 12:05 mustkem

Hi guys. Spent several hours yesterday and solved it somehow. I tried many things, so I don't remember which one exactly solves the problem (ping me, if the solution below won't help).

Start here: https://developer.apple.com/documentation/xcode/diagnosing-performance-issues-early (i put the whole link, so you see, that it's Apple and not a scam). What you need to do is go to Product > Scheme > Edit Scheme to display the scheme editor. Select the Run schemes, navigate to the Diagnostics section, and unselect the Thread Performance Checker tool checkbox.

it's gone but the app is still slower

vanhai989 avatar Jun 28 '23 14:06 vanhai989

I just have closed the Xcode and Killed it completely. And Restarted it again and It resolved my Problem.

anshhTID avatar Jun 30 '23 21:06 anshhTID