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

Crash in PeachCollectorEvent.shouldBeFlushedInBackgroundState #2

Open
nickenilsson opened this issue Nov 2, 2020 · 1 comment
Open

Comments

@nickenilsson
Copy link

We have a minor crash (SR). Not very common though. A few hundred per week or so.

Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x1b739cbf0 object_getIndexedIvars + 28
1 CoreData 0x1bc245aa0 snapshot_get_value_as_object + 44
2 PeachCollector 0x105df7da0 -[PeachCollectorEvent(Peach) shouldBeFlushedWhenReceivedInBackgroundState] + 249 (PeachCollectorEvent.m:249)
3 PeachCollector 0x105dfb5ec __32-[PeachCollectorQueue addEvent:]_block_invoke_2 + 113 (PeachCollectorQueue.m:113)
4 libdispatch.dylib 0x1b7326134 _dispatch_call_block_and_release + 32
5 libdispatch.dylib 0x1b73275ac _dispatch_client_callout + 20
6 libdispatch.dylib 0x1b73337d4 _dispatch_main_queue_callback_4CF + 832
7 CoreFoundation 0x1b76008d4 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
8 CoreFoundation 0x1b75fb58c __CFRunLoopRun + 1692
9 CoreFoundation 0x1b75fabc8 CFRunLoopRunSpecific + 480
10 GraphicsServices 0x1c19e35cc GSEventRunModal + 164
11 UIKitCore 0x1bb7ad744 UIApplicationMain + 1936
12 Play 0x104845ee4 main + 23 (AppDelegate.swift:23)
13 libdyld.dylib 0x1b7477384 start + 4

@nickenilsson
Copy link
Author

nickenilsson commented Jan 27, 2021

I did some further investigating and found a deeper stacktrace:

#0 (null) in __pthread_kill ()
#1 (null) in pthread_kill ()
#2 (null) in abort ()
#3 (null) in __31-[PeachCollectorDataStore init]_block_invoke.cold.1 ()
#4 (null) in __31-[PeachCollectorDataStore init]_block_invoke ()
#5 (null) in -[NSPersistentStoreCoordinator _doAddPersistentStoreWithDescription:privateCopy:completeOnMainThread:withHandler:] ()
#6 (null) in -[NSPersistentStoreCoordinator addPersistentStoreWithDescription:completionHandler:] ()
#7 (null) in -[NSPersistentContainer _loadStoreDescriptions:withCompletionHandler:] ()
#8 (null) in -[NSPersistentContainer loadPersistentStoresWithCompletionHandler:] ()
#9 (null) in -[PeachCollectorDataStore init] ()
#10 (null) in -[PeachCollector init] ()
#11 (null) in __33+[PeachCollector sharedCollector]_block_invoke ()
#12 (null) in _dispatch_client_callout ()
#13 (null) in _dispatch_once_callout ()
#14 (null) in +[PeachCollector sharedCollector] ()
#15 (null) in +[PeachCollector load] ()

It seems to me that this is what's causing the crash:

            if (error != nil) {
                // Replace this implementation with code to handle the error appropriately.
                // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
                
                /*
                 Typical reasons for an error here include:
                 * The parent directory does not exist, cannot be created, or disallows writing.
                 * The persistent store is not accessible, due to permissions or data protection when the device is locked.
                 * The device is out of space.
                 * The store could not be migrated to the current model version.
                 Check the error message to determine what the actual problem was.
                 */
                NSLog(@"Unresolved error %@, %@", error, error.userInfo);
                abort();
            }
        }];```

In the init function of PeachCollectorDataStore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant