Crash in iOS10 when sectioned listmonitor is released #87

Closed
opened 2025-12-29 15:23:59 +01:00 by adam · 4 comments
Owner

Originally created by @laeroah on GitHub (Sep 23, 2016).

Reproducible in mini test project here:
https://github.com/laeroah/CoreStore-SectionedList-TestCase/tree/laeroah
forked from jamesbebbington's repo

I added a "GO" button on the top right to open a new view containing the same stuff. When you go there and pop the view controller, the crash will happen.

crash log

#0. Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x18ce0ef30 objc_msgSend + 16
1  CoreData                       0x1906a426c -[NSPersistentStoreRequest dealloc] + 44
2  CoreData                       0x1906a422c -[NSFetchRequest dealloc] + 308
3  CoreData                       0x190783718 -[NSFetchedResultsController dealloc] + 348
4  CoreStore                      0x10183d1f4 @objc CoreStoreFetchedResultsController.__deallocating_deinit (CoreStoreFetchedResultsController.swift)
5  CoreStore                      0x1018b943c ListMonitor.deinit (ListMonitor.swift:1023)
6  CoreStore                      0x1018b93f0 ListMonitor.__deallocating_deinit (ListMonitor.swift)

Appreciate the help!

Originally created by @laeroah on GitHub (Sep 23, 2016). Reproducible in mini test project here: https://github.com/laeroah/CoreStore-SectionedList-TestCase/tree/laeroah forked from jamesbebbington's repo I added a "GO" button on the top right to open a new view containing the same stuff. When you go there and pop the view controller, the crash will happen. crash log ``` #0. Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x18ce0ef30 objc_msgSend + 16 1 CoreData 0x1906a426c -[NSPersistentStoreRequest dealloc] + 44 2 CoreData 0x1906a422c -[NSFetchRequest dealloc] + 308 3 CoreData 0x190783718 -[NSFetchedResultsController dealloc] + 348 4 CoreStore 0x10183d1f4 @objc CoreStoreFetchedResultsController.__deallocating_deinit (CoreStoreFetchedResultsController.swift) 5 CoreStore 0x1018b943c ListMonitor.deinit (ListMonitor.swift:1023) 6 CoreStore 0x1018b93f0 ListMonitor.__deallocating_deinit (ListMonitor.swift) ``` Appreciate the help!
adam added the duplicate label 2025-12-29 15:23:59 +01:00
adam closed this issue 2025-12-29 15:23:59 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Sep 24, 2016):

@laeroah Hi, I am pretty sure this is the same symptom with https://github.com/JohnEstropia/CoreStore/issues/100 . Have you tried the workaround there and see if it works?

@JohnEstropia commented on GitHub (Sep 24, 2016): @laeroah Hi, I am pretty sure this is the same symptom with https://github.com/JohnEstropia/CoreStore/issues/100 . Have you tried the workaround there and see if it works?
Author
Owner

@laeroah commented on GitHub (Sep 24, 2016):

@JohnEstropia the workaround suggested in #100 is already applied, but I think this is a different crash.

@laeroah commented on GitHub (Sep 24, 2016): @JohnEstropia the workaround suggested in #100 is already applied, but I think this is a different crash.
Author
Owner

@laeroah commented on GitHub (Sep 25, 2016):

If I add -com.apple.CoreData.ConcurrencyDebug 1, it will crash right away without doing anything else due to violation multithreading rules.
screen shot 2016-09-25 at 2 15 16 am

@laeroah commented on GitHub (Sep 25, 2016): If I add `-com.apple.CoreData.ConcurrencyDebug 1`, it will crash right away without doing anything else due to violation multithreading rules. <img width="760" alt="screen shot 2016-09-25 at 2 15 16 am" src="https://cloud.githubusercontent.com/assets/1928509/18813375/0ec68f60-82c6-11e6-81db-684a7063411a.png">
Author
Owner

@JohnEstropia commented on GitHub (Sep 25, 2016):

Yup, this is the drawback of the fix I was talking about here: https://github.com/JohnEstropia/CoreStore/issues/100#issuecomment-249246004

This fixed the crash for me. Here's the problem: doing this breaks CoreStore's unit tests and demo app. 

Commenting out the override var affectedStores seems to just delay the inevitable ARC bug. I'm closing this ticket for now as a duplicate, unless we find evidence otherwise.

@JohnEstropia commented on GitHub (Sep 25, 2016): Yup, this is the drawback of the fix I was talking about here: https://github.com/JohnEstropia/CoreStore/issues/100#issuecomment-249246004 ``` This fixed the crash for me. Here's the problem: doing this breaks CoreStore's unit tests and demo app. ``` Commenting out the `override var affectedStores` seems to just delay the inevitable ARC bug. I'm closing this ticket for now as a duplicate, unless we find evidence otherwise.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#87