Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: RLMException thread constructor failed: Resource temporarily unavailable #8011

Closed
kafejo opened this issue Oct 31, 2022 · 8 comments

Comments

@kafejo
Copy link

kafejo commented Oct 31, 2022

How frequently does the bug occur?

Seen once

Description

Crash on writeAsync.

Stacktrace & log output

0	CoreFoundation	
___exceptionPreprocess
1	libobjc.A.dylib	
_objc_exception_throw
2	Realm	
-[RLMRealm beginAsyncWriteTransaction:]

3	RealmSwift	
Realm.writeAsync(_:onComplete:)

4	MemoryShare	
Persistence.swift:69:19
closure #1 in Persistence.upsert(services:removeMissing:)

5	MemoryShare	
<compiler-generated>
partial apply for closure #1 in Persistence.upsert(services:removeMissing:)

6	PromiseKit	
Promise.init(resolver:)

7	MemoryShare	
Persistence.swift
specialized Promise.__allocating_init(resolver:)

8	MemoryShare	
<compiler-generated>
partial apply for closure #1 in ServicesViewModel.fetchServices(mode:)

9	PromiseKit	
closure #1 in closure #1 in Thenable.then<A>(on:flags:_:)

10	PromiseKit	
thunk for @escaping @callee_guaranteed () -> ()

11	libdispatch.dylib	
__dispatch_call_block_and_release
12	libdispatch.dylib	
__dispatch_client_callout
13	libdispatch.dylib	
__dispatch_main_queue_callback_4CF
14	CoreFoundation	
___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
15	CoreFoundation	
___CFRunLoopRun
16	CoreFoundation	
_CFRunLoopRunSpecific
17	GraphicsServices	
_GSEventRunModal
18	UIKitCore	
-[UIApplication _run]
19	UIKitCore	
_UIApplicationMain
20	MemoryShare	
AppDelegate.swift:19:7
main

21	dyld	
start

Can you reproduce the bug?

Not yet

Reproduction Steps

The crash happened to a customer in production. I cannot reproduce it but I was wondering what does the crash message actually mean and if it's something I should worry about.

Version

10.32.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

iOS 15.1

Build environment

Xcode version: 14.0
Dependency manager and version: Cocoapods 1.11.3

@leemaguire
Copy link
Contributor

Hi @kafejo can you show some code with how you are using Realm? Can you also submit the full stack trace?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Nov 3, 2022
@kafejo
Copy link
Author

kafejo commented Nov 4, 2022

Sure!
Here's the upsert function mentioned in the stack trace

func upsert(services: [Service], removeMissing: Bool) -> Promise<Void> {
    return Promise { seal in

        let realm = RealmManager.shared.realmInstance
        let forRemoval: LazyFilterSequence<Results<StoredService>>?

        if removeMissing {
            let storedServices = realm.objects(StoredService.self)
            let missingStored = storedServices.filter { item in !services.contains { $0.id == item.id } }

            forRemoval = missingStored
        } else {
            forRemoval = nil
        }

        realm.writeAsync {
            let storedServices = services.map(StoredService.init)
            realm.add(storedServices, update: .modified)

            if let forRemoval = forRemoval {
                realm.delete(forRemoval)
            }
        } onComplete: { error in
            if let error = error {
                seal.reject(error)
            } else {
                seal.fulfill_()
            }
        }
    }
}

where the Realm manager method is just

var realmInstance: Realm {
    // swiftlint:disable:next force_try
    try! Realm()
}

Here's a full stack trace:

RLMException
RLMRealm
thread constructor failed: Resource temporarily unavailable
Oct 28th 2022, 18:35:28 UTC

STACKTRACE

CrashReporter Key:  3615afe35aba518e1a4d7badc1d0dec0c61fb90e
Hardware Model:     iPad11,4
Process:            MemoryShare
Identifier:         ******
Version:            1.11.1
Role:               Foreground
OS Version:         iOS 15.1


RLMException: thread constructor failed: Resource temporarily unavailable

0  CoreFoundation    ___exceptionPreprocess
1  libobjc.A.dylib   _objc_exception_throw
2  Realm             -[RLMRealm beginAsyncWriteTransaction:]
3  RealmSwift        Realm.writeAsync(_:onComplete:)
4  MemoryShare       closure #1 in Persistence.upsert(services:removeMissing:) (Persistence.swift:69:19)
5  MemoryShare       partial apply for closure #1 in Persistence.upsert(services:removeMissing:) (<compiler-generated>)
6  PromiseKit        Promise.init(resolver:)
7  MemoryShare       specialized Promise.__allocating_init(resolver:) (Persistence.swift)
8  MemoryShare       partial apply for closure #1 in ServicesViewModel.fetchServices(mode:) (<compiler-generated>)
9  PromiseKit        closure #1 in closure #1 in Thenable.then<A>(on:flags:_:)
10 PromiseKit        thunk for @escaping @callee_guaranteed () -> ()
11 libdispatch.dylib __dispatch_call_block_and_release
12 libdispatch.dylib __dispatch_client_callout
13 libdispatch.dylib __dispatch_main_queue_callback_4CF
14 CoreFoundation    ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
15 CoreFoundation    ___CFRunLoopRun
16 CoreFoundation    _CFRunLoopRunSpecific
17 GraphicsServices  _GSEventRunModal
18 UIKitCore         -[UIApplication _run]
19 UIKitCore         _UIApplicationMain
20 MemoryShare       main (AppDelegate.swift:19:7)
21 dyld              start

THREADS

Thread 0 - (TH_STATE_RUNNING)
0  CoreFoundation    ___exceptionPreprocess
1  libobjc.A.dylib   _objc_exception_throw
2  Realm             -[RLMRealm beginAsyncWriteTransaction:]
3  RealmSwift        Realm.writeAsync(_:onComplete:)
4  MemoryShare       closure #1 in Persistence.upsert(services:removeMissing:) (Persistence.swift:69:19)
5  MemoryShare       partial apply for closure #1 in Persistence.upsert(services:removeMissing:) (<compiler-generated>)
6  PromiseKit        Promise.init(resolver:)
7  MemoryShare       specialized Promise.__allocating_init(resolver:) (Persistence.swift)
8  MemoryShare       partial apply for closure #1 in ServicesViewModel.fetchServices(mode:) (<compiler-generated>)
9  PromiseKit        closure #1 in closure #1 in Thenable.then<A>(on:flags:_:)
10 PromiseKit        thunk for @escaping @callee_guaranteed () -> ()
11 libdispatch.dylib __dispatch_call_block_and_release
12 libdispatch.dylib __dispatch_client_callout
13 libdispatch.dylib __dispatch_main_queue_callback_4CF
14 CoreFoundation    ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
15 CoreFoundation    ___CFRunLoopRun
16 CoreFoundation    _CFRunLoopRunSpecific
17 GraphicsServices  _GSEventRunModal
18 UIKitCore         -[UIApplication _run]
19 UIKitCore         _UIApplicationMain
20 MemoryShare       main (AppDelegate.swift:19:7)
21 dyld              start

Thread 1 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 Foundation              -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation              -[NSRunLoop(NSRunLoop) runUntilDate:]
7 UIKitCore               -[UIEventFetcher threadMain]
8 Foundation              ___NSThread__start__
9 libsystem_pthread.dylib __pthread_start

Thread 2 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 libsystem_kernel.dylib  _thread_suspend
3 Bugsnag                 ksmachexc_i_handleExceptions
4 libsystem_pthread.dylib __pthread_start

Thread 3 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 Bugsnag                 ksmachexc_i_handleExceptions
3 libsystem_pthread.dylib __pthread_start

Thread 4 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _semaphore_timedwait_trap
1 libdispatch.dylib       __dispatch_sema4_timedwait
2 libdispatch.dylib       __dispatch_semaphore_wait_slow
3 Bugsnag                 -[BSGAppHangDetector detectAppHangs]
4 Foundation              ___NSThread__start__
5 libsystem_pthread.dylib __pthread_start

Thread 5 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 FirebaseCrashlytics     FIRCLSMachExceptionServer
3 libsystem_pthread.dylib __pthread_start

Thread 6 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 AudioSession            CADeprecated::GenericRunLoopThread::Entry(void*)
6 AudioSession            CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*)
7 libsystem_pthread.dylib __pthread_start

Thread 7 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 CFNetwork               0x180dd869c (0x180dd84d0 + 460)
6 Foundation              ___NSThread__start__
7 libsystem_pthread.dylib __pthread_start

Thread 8 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 Foundation              -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Intercom                -[_SRRunLoopThread main]
7 Foundation              ___NSThread__start__
8 libsystem_pthread.dylib __pthread_start

Thread 9 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _select$DARWIN_EXTSN
1 CoreFoundation          ___CFSocketManager
2 libsystem_pthread.dylib __pthread_start

Thread 10 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 CoreFoundation          _CFRunLoopRun
6 CoreMotion              0x18d344540 (0x18d344090 + 1200)
7 libsystem_pthread.dylib __pthread_start

Thread 11 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread

Thread 12 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread

Thread 13 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread

Thread 14 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread

Thread 15 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _kevent
1 Realm                   realm::_impl::ExternalCommitHelper::listen()
2 Realm                   void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >(void*)
3 libsystem_pthread.dylib __pthread_start

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Nov 4, 2022
@leemaguire
Copy link
Contributor

cc @tgoyne do you know what could cause this exception?

@tgoyne
Copy link
Member

tgoyne commented Nov 4, 2022

writeAsync() uses a background thread to wait for the write lock, which is created the first time it's needed. This error indicates that creating the thread failed due to resource exhaustion, either by hitting the maximum number of threads or due to running out of memory. If the crash report is accurate and there's only 15 threads then it's not due to hitting the maximum thread count, so that suggests that the device is out of ram and this is just the first memory allocation that failed.

We should probably have some better error handling here to report a more helpful error, but a one time OOM error doesn't seem super concerning.

@kafejo
Copy link
Author

kafejo commented Nov 8, 2022

Great, thanks for the explanation! That's indeed not that concerning.

@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label Nov 10, 2022
@sync-by-unito sync-by-unito bot closed this as completed Nov 10, 2022
@kafejo
Copy link
Author

kafejo commented Nov 17, 2022

I actually encountered it again at different place. Again only 15 threads but also free RAM.

image

Fatal error
LiveStreamViewController.swift
'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=2 "Resource temporarily unavailable" UserInfo={Error Code=2, NSFilePath=/var/mobile/Containers/Data/Application/616C0777-6343-41B1-AE31-B07EA7CFA852/Documents/default.realm, Underlying=n/a, NSLocalizedDescription=Resource temporarily unavailable}
Nov 14th 2022, 19:31:42 UTC

STACKTRACE

CrashReporter Key:  db11075d6467dd6bc401b9b8531b75855b1f356a
Hardware Model:     iPad11,4
Process:            MemoryShare
Identifier:         *****
Version:            1.12
Role:               Foreground
OS Version:         iOS 15.6.1
Exception Type:     EXC_BREAKPOINT 
Exception Subtype:  KERN_INVALID_ADDRESS


Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=2 "Resource temporarily unavailable" UserInfo={Error Code=2, NSFilePath=/var/mobile/Containers/Data/Application/616C0777-6343-41B1-AE31-B07EA7CFA852/Documents/default.realm, Underlying=n/a, NSLocalizedDescription=Resource temporarily unavailable}

0  libswiftCore.dylib _swift_unexpectedError
1  MemoryShare        specialized Persistence.createEventVideoLink(eventId:assetIdentifier:createdAt:) (LiveStreamViewController.swift)
2  MemoryShare        thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
3  libdispatch.dylib  __dispatch_call_block_and_release
4  libdispatch.dylib  __dispatch_client_callout
5  libdispatch.dylib  __dispatch_main_queue_drain
6  libdispatch.dylib  __dispatch_main_queue_callback_4CF
7  CoreFoundation     ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
8  CoreFoundation     ___CFRunLoopRun
9  CoreFoundation     _CFRunLoopRunSpecific
10 GraphicsServices   _GSEventRunModal
11 UIKitCore          -[UIApplication _run]
12 UIKitCore          _UIApplicationMain
13 MemoryShare        main (AppDelegate.swift:18:7)
14 dyld               start

THREADS

Thread 0 - (TH_STATE_WAITING)
0  libswiftCore.dylib _swift_unexpectedError
1  MemoryShare        specialized Persistence.createEventVideoLink(eventId:assetIdentifier:createdAt:) (LiveStreamViewController.swift)
2  MemoryShare        thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
3  libdispatch.dylib  __dispatch_call_block_and_release
4  libdispatch.dylib  __dispatch_client_callout
5  libdispatch.dylib  __dispatch_main_queue_drain
6  libdispatch.dylib  __dispatch_main_queue_callback_4CF
7  CoreFoundation     ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
8  CoreFoundation     ___CFRunLoopRun
9  CoreFoundation     _CFRunLoopRunSpecific
10 GraphicsServices   _GSEventRunModal
11 UIKitCore          -[UIApplication _run]
12 UIKitCore          _UIApplicationMain
13 MemoryShare        main (AppDelegate.swift:18:7)
14 dyld               start

Thread 1 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 Foundation              -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation              -[NSRunLoop(NSRunLoop) runUntilDate:]
7 UIKitCore               -[UIEventFetcher threadMain]
8 Foundation              ___NSThread__start__
9 libsystem_pthread.dylib __pthread_start

Thread 2 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 FirebaseCrashlytics     FIRCLSMachExceptionServer
3 libsystem_pthread.dylib __pthread_start

Thread 3 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 Bugsnag                 ksmachexc_i_handleExceptions
3 libsystem_pthread.dylib __pthread_start

Thread 4 - KSCrash Exception Handler (Primary) - (TH_STATE_RUNNING)
0 unknown file unknown method

Thread 5 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _semaphore_timedwait_trap
1 libdispatch.dylib       __dispatch_sema4_timedwait
2 libdispatch.dylib       __dispatch_semaphore_wait_slow
3 Bugsnag                 -[BSGAppHangDetector detectAppHangs]
4 Bugsnag                 DetectAppHangs
5 libsystem_pthread.dylib __pthread_start

Thread 6 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 AudioSession            CADeprecated::GenericRunLoopThread::Entry(void*)
6 AudioSession            CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*)
7 libsystem_pthread.dylib __pthread_start

Thread 7 - (TH_STATE_WAITING)
0  libsystem_kernel.dylib  ___semwait_signal_nocancel
1  libsystem_c.dylib       _nanosleep$NOCANCEL
2  libsystem_c.dylib       _sleep$NOCANCEL
3  libdispatch.dylib       __dispatch_temporary_resource_shortage
4  libdispatch.dylib       __os_object_alloc_realized
5  libdispatch.dylib       _dispatch_data_create_alloc
6  CFNetwork               0x180d89ccc (0x180d89c8c + 64)
7  libdispatch.dylib       __dispatch_client_callout
8  libdispatch.dylib       __dispatch_block_invoke_direct
9  CFNetwork               0x180deb174 (0x180deb14c + 40)
10 CoreFoundation          _CFArrayApplyFunction
11 CFNetwork               0x180deb04c (0x180deafc8 + 132)
12 CFNetwork               0x180ded610 (0x180ded4c4 + 332)
13 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
14 CoreFoundation          ___CFRunLoopDoSource0
15 CoreFoundation          ___CFRunLoopDoSources0
16 CoreFoundation          ___CFRunLoopRun
17 CoreFoundation          _CFRunLoopRunSpecific
18 CFNetwork               0x180dec1d8 (0x180dec004 + 468)
19 Foundation              ___NSThread__start__
20 libsystem_pthread.dylib __pthread_start

Thread 8 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 CoreFoundation          _CFRunLoopRun
6 CoreMotion              0x18d80ea98 (0x18d80e5e4 + 1204)
7 libsystem_pthread.dylib __pthread_start

Thread 9 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _mach_msg_trap
1 libsystem_kernel.dylib  _mach_msg
2 CoreFoundation          ___CFRunLoopServiceMachPort
3 CoreFoundation          ___CFRunLoopRun
4 CoreFoundation          _CFRunLoopRunSpecific
5 Foundation              -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Intercom                -[_SRRunLoopThread main]
7 Foundation              ___NSThread__start__
8 libsystem_pthread.dylib __pthread_start

Thread 10 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _select$DARWIN_EXTSN
1 CoreFoundation          ___CFSocketManager
2 libsystem_pthread.dylib __pthread_start

Thread 11 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  _semaphore_timedwait_trap
1 libdispatch.dylib       __dispatch_sema4_timedwait
2 libdispatch.dylib       __dispatch_semaphore_wait_slow
3 libdispatch.dylib       __dispatch_worker_thread
4 libsystem_pthread.dylib __pthread_start

Thread 12 - (TH_STATE_WAITING)
0  libsystem_kernel.dylib   _mach_msg_trap
1  libsystem_kernel.dylib   _mach_msg
2  libdispatch.dylib        __dispatch_mach_send_and_wait_for_reply
3  libdispatch.dylib        _dispatch_mach_send_with_result_and_wait_for_reply
4  libxpc.dylib             _xpc_connection_send_message_with_reply_sync
5  Foundation               ___NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__
6  Foundation               -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]
7  Foundation               -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:]
8  Foundation               __NSXPCDistantObjectSimpleMessageSend2
9  CoreData                 -[NSXPCStoreConnection sendMessage:store:error:]
10 CoreData                 -[NSXPCStoreConnection sendMessageWithContext:]
11 CoreData                 ___54-[NSXPCStoreConnectionManager sendMessageWithContext:]_block_invoke
12 libdispatch.dylib        __dispatch_client_callout
13 libdispatch.dylib        __dispatch_sync_invoke_and_complete
14 CoreData                 -[NSXPCStoreConnectionManager sendMessageWithContext:]
15 CoreData                 -[NSXPCStore sendMessage:fromContext:interrupts:error:]
16 CoreData                 -[NSXPCStore executeRequest:withContext:error:]
17 CoreData                 ___65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke.819
18 CoreData                 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:]
19 CoreData                 -[NSPersistentStoreCoordinator executeRequest:withContext:error:]
20 CoreData                 -[NSManagedObjectContext executeRequest:error:]
21 PhotoLibraryServices     +[PLPersistentHistoryUtilities _executePersistentHistoryChangeRequest:withContext:]
22 PhotoLibraryServices     ___102+[PLPersistentHistoryUtilities fetchTransactionsSinceMarker:withFetchRequest:batchSize:context:error:]_block_invoke
23 PhotoLibraryServices     ___75-[NSManagedObjectContext(PLManagedObjectContext) pl_resultWithError:block:]_block_invoke
24 CoreData                 _developerSubmittedBlockToNSManagedObjectContextPerform
25 libdispatch.dylib        __dispatch_client_callout
26 libdispatch.dylib        __dispatch_lane_barrier_sync_invoke_and_complete
27 CoreData                 -[NSManagedObjectContext performBlockAndWait:]
28 PhotoLibraryServices     -[NSManagedObjectContext(PLManagedObjectContext) pl_resultWithError:block:]
29 PhotoLibraryServices     +[PLPersistentHistoryUtilities fetchTransactionsSinceMarker:withFetchRequest:batchSize:context:error:]
30 PhotoLibraryServices     +[PLPersistentHistoryTransactionIterator iteratorSinceMarker:withFetchRequest:managedObjectObjectContext:error:]
31 PhotoLibraryServices     +[PLPersistentHistoryTransactionIterator iteratorSinceToken:withManagedObjectObjectContext:error:]
32 PhotoLibraryServices     -[PLPersistentHistoryChangeDistributor fetchTransactionsSinceLastToken]
33 PhotoLibraryServices     -[PLPersistentHistoryChangeDistributor _inq_distributeNewTransactionsSinceLastTokenWithReason:xpcTransaction:]
34 libdispatch.dylib        __dispatch_client_callout
35 libdispatch.dylib        __dispatch_lane_barrier_sync_invoke_and_complete
36 PhotoLibraryServices     -[PLPersistentHistoryChangeDistributor handleRemoteNotificationOfType:withTransaction:]
37 PhotoLibraryServices     ___78-[PLPersistentHistoryChangeDistributor _inq_startObservingRemoteNotifications]_block_invoke
38 PhotoLibraryServices     -[PLChangeHandlingNotificationObserver _inq_handleHighPriorityNotification]
39 PhotoLibraryServices     ___91-[PLChangeHandlingNotificationObserver _locked_startObservingRemoteNotificationsWithBlock:]_block_invoke.36
40 PhotoLibraryServicesCore ___pl_notify_register_dispatch_block_invoke
41 libsystem_notify.dylib   0x1a04f93ac (0x1a04f9368 + 68)
42 libdispatch.dylib        __dispatch_block_async_invoke2
43 libdispatch.dylib        __dispatch_client_callout
44 libdispatch.dylib        __dispatch_lane_serial_drain
45 libdispatch.dylib        __dispatch_lane_invoke
46 libdispatch.dylib        __dispatch_lane_serial_drain
47 libdispatch.dylib        __dispatch_lane_invoke
48 libdispatch.dylib        __dispatch_workloop_worker_thread
49 libsystem_pthread.dylib  __pthread_wqthread

Thread 13 - (TH_STATE_WAITING)
0 libsystem_pthread.dylib _start_wqthread

Thread 14 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread

Thread 15 - (TH_STATE_WAITING)
0 libsystem_kernel.dylib  ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread

Seems like the issue is somewhere else?

@kafejo
Copy link
Author

kafejo commented Nov 28, 2022

@tgoyne or @leemaguire could you please advise or do I need to open a new ticket? I cannot reopen this one. It's still happening in multiple places of my app.

@Nahatakyan
Copy link

Same issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants