Crash when list monitor refetch is called #93

Closed
opened 2025-12-29 18:22:49 +01:00 by adam · 15 comments
Owner

Originally created by @laeroah on GitHub (Oct 9, 2016).

I'm getting a crash when I call refetch on a ListMonitor. This crash is 100% reproducible.

screen shot 2016-10-09 at 11 01 49 am
Originally created by @laeroah on GitHub (Oct 9, 2016). I'm getting a crash when I call `refetch` on a `ListMonitor`. This crash is 100% reproducible. <img width="812" alt="screen shot 2016-10-09 at 11 01 49 am" src="https://cloud.githubusercontent.com/assets/1928509/19221355/ec973304-8e0f-11e6-85da-1d63289ae580.png">
adam closed this issue 2025-12-29 18:22:49 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Oct 10, 2016):

Were you calling refetch before this fix was added?

@JohnEstropia commented on GitHub (Oct 10, 2016): Were you calling `refetch` before [this fix](https://github.com/JohnEstropia/CoreStore/issues/100) was added?
Author
Owner

@laeroah commented on GitHub (Oct 10, 2016):

I m using the develop branch. I guess the fix wasn't merged yet. Sry, I will override this.
Any plan on fixing this problem in the main branch?

@laeroah commented on GitHub (Oct 10, 2016): I m using the develop branch. I guess the fix wasn't merged yet. Sry, I will override this. Any plan on fixing this problem in the main branch?
Author
Owner

@JohnEstropia commented on GitHub (Oct 10, 2016):

Sorry, that's not what I mean. The fix is already in the master branch, but I wanted to know if you have the same problem before the fix was added.

@JohnEstropia commented on GitHub (Oct 10, 2016): Sorry, that's not what I mean. The fix is already in the master branch, but I wanted to know if you have the same problem before the fix was added.
Author
Owner

@JohnEstropia commented on GitHub (Oct 10, 2016):

The demo app's "Colors" demo doesn't encounter this problem though... hmm

@JohnEstropia commented on GitHub (Oct 10, 2016): The demo app's "Colors" demo doesn't encounter this problem though... hmm
Author
Owner

@laeroah commented on GitHub (Oct 10, 2016):

hmm, I think so. I was using the master branch tag 2.1.2, but it was crashing. I just changed the CoreStoreBridge.m implementation of affectedStores to exactly like you did in the fix, and it stopped crashing.

- (NSArray<NSPersistentStore *> *)affectedStores {

    // Bugfix for NSFetchRequest messing up memory management for `affectedStores`
    // http://stackoverflow.com/questions/14396375/nsfetchedresultscontroller-crashes-in-ios-6-if-affectedstores-is-specified
    CFBridgingRetain([super affectedStores]);
    return [super affectedStores];
}
@laeroah commented on GitHub (Oct 10, 2016): hmm, I think so. I was using the master branch tag 2.1.2, but it was crashing. I just changed the CoreStoreBridge.m implementation of `affectedStores` to exactly like you did in the fix, and it stopped crashing. ``` - (NSArray<NSPersistentStore *> *)affectedStores { // Bugfix for NSFetchRequest messing up memory management for `affectedStores` // http://stackoverflow.com/questions/14396375/nsfetchedresultscontroller-crashes-in-ios-6-if-affectedstores-is-specified CFBridgingRetain([super affectedStores]); return [super affectedStores]; } ```
Author
Owner

@laeroah commented on GitHub (Oct 10, 2016):

does the demo app use sectioned list?

@laeroah commented on GitHub (Oct 10, 2016): does the demo app use sectioned list?
Author
Owner

@JohnEstropia commented on GitHub (Oct 10, 2016):

I just changed the CoreStoreBridge.m implementation of affectedStores to exactly like you did in the fix, and it stopped crashing.

That's not the latest fix. That one still breaks on some other case (sorry I forgot).
The latest fix is the one in the master branch: https://github.com/JohnEstropia/CoreStore/blob/master/Sources/ObjectiveC/CoreStoreBridge.m

does the demo app use sectioned list?

Yes

@JohnEstropia commented on GitHub (Oct 10, 2016): > I just changed the CoreStoreBridge.m implementation of affectedStores to exactly like you did in the fix, and it stopped crashing. That's not the latest fix. That one still breaks on some other case (sorry I forgot). The latest fix is the one in the master branch: https://github.com/JohnEstropia/CoreStore/blob/master/Sources/ObjectiveC/CoreStoreBridge.m > does the demo app use sectioned list? Yes
Author
Owner

@laeroah commented on GitHub (Oct 10, 2016):

ok, so I did have the latest master. I just double checked, and it does crash. Let me take a look at the demo app.

@laeroah commented on GitHub (Oct 10, 2016): ok, so I did have the latest master. I just double checked, and it does crash. Let me take a look at the demo app.
Author
Owner

@JohnEstropia commented on GitHub (Oct 10, 2016):

Thanks. The cause is the same ARC bug, but it would be great help if you can isolate the conditions to reproduce so we can tweak the workaround without breaking other cases.

@JohnEstropia commented on GitHub (Oct 10, 2016): Thanks. The cause is the same ARC bug, but it would be great help if you can isolate the conditions to reproduce so we can tweak the workaround without breaking other cases.
Author
Owner

@JohnEstropia commented on GitHub (Oct 26, 2016):

@laeroah Hi, have you resolved this issue? I haven't encountered this problem on my side in 2 apps I use sectioned monitors in..

@JohnEstropia commented on GitHub (Oct 26, 2016): @laeroah Hi, have you resolved this issue? I haven't encountered this problem on my side in 2 apps I use sectioned monitors in..
Author
Owner

@laeroah commented on GitHub (Oct 26, 2016):

Hey, thanks for checking. It looks fine now. Not crashing anymore!

Sent from my iPad

On Oct 25, 2016, at 6:44 PM, John Estropia notifications@github.com wrote:

@laeroah Hi, have you resolved this issue? I haven't encountered this problem on my side in 2 apps I use sectioned monitors in..


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@laeroah commented on GitHub (Oct 26, 2016): Hey, thanks for checking. It looks fine now. Not crashing anymore! Sent from my iPad > On Oct 25, 2016, at 6:44 PM, John Estropia notifications@github.com wrote: > > @laeroah Hi, have you resolved this issue? I haven't encountered this problem on my side in 2 apps I use sectioned monitors in.. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@JohnEstropia commented on GitHub (Oct 27, 2016):

Thanks for the update :) Closing this issue now

@JohnEstropia commented on GitHub (Oct 27, 2016): Thanks for the update :) Closing this issue now
Author
Owner

@laeroah commented on GitHub (Apr 3, 2017):

hi, looks like this problem is back. I'm getting consistent crash when I try to refetch.

@laeroah commented on GitHub (Apr 3, 2017): hi, looks like this problem is back. I'm getting consistent crash when I try to refetch.
Author
Owner

@JohnEstropia commented on GitHub (Apr 3, 2017):

@laeroah I'm not sure there were any changes there. Have you changed CoreStore versions or Xcode versions recently?

@JohnEstropia commented on GitHub (Apr 3, 2017): @laeroah I'm not sure there were any changes there. Have you changed CoreStore versions or Xcode versions recently?
Author
Owner

@laeroah commented on GitHub (Apr 3, 2017):

I m on CoreStore 8.10. xcode8.3.
I think this issue's been there for a while. I was pointing to my fork
without the code which causes the crash before.

On Mon, Apr 3, 2017 at 5:45 AM, John Estropia notifications@github.com
wrote:

@laeroah https://github.com/laeroah I'm not sure there were any changes
there. Have you changed CoreStore versions or Xcode versions recently?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/JohnEstropia/CoreStore/issues/110#issuecomment-291096620,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB1tPVP8mgmdWp43XNqHoQQxrBrH5efVks5rsL_RgaJpZM4KSBtV
.

@laeroah commented on GitHub (Apr 3, 2017): I m on CoreStore 8.10. xcode8.3. I think this issue's been there for a while. I was pointing to my fork without the code which causes the crash before. On Mon, Apr 3, 2017 at 5:45 AM, John Estropia <notifications@github.com> wrote: > @laeroah <https://github.com/laeroah> I'm not sure there were any changes > there. Have you changed CoreStore versions or Xcode versions recently? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/JohnEstropia/CoreStore/issues/110#issuecomment-291096620>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AB1tPVP8mgmdWp43XNqHoQQxrBrH5efVks5rsL_RgaJpZM4KSBtV> > . >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore-JohnEstropia#93