ftchirou/PredicateKit

Lib crashes randomly with signal SIGABRT

Opened this issue · 4 comments

The lib crashes randomly on Line 335: return try context.fetch(request) in public func result() throws -> [Entity]

It seemed like it started after upgrading to xCode 15.

PS. I'm using it for SwiftUI.

Hey @srenrd! Thank you for reporting this. Please could you provide a small sample project reproducing the issue? Thank you.

Hi, I've tried to recreate this bug in a new project, but without success. It is far to random. During a day of development i get this crash 0-2 times.
However it does seem like large data sets and SwiftUI navigationLink plays a part in the crash.

I'll keep investigating and report back with further details.

Hi again. I've managed to catch a bit of info on this. As described before, it seems totally random when this happens. But it is always the same line of code that crashes.

It happens when the .result() is called.

App(14673,0x305b87000) malloc: Non-aligned pointer 0x6000006f6b20 being freed (2)
App(14673,0x305b87000) malloc: *** set a breakpoint in malloc_error_break to debug

Screenshot 2024-06-07 at 10 24 30

I wonder if this is concurrency related. Do you get any errors/warnings when you pass the CoreData concurrency debug arguments on launch to your app?

-com.apple.CoreData.ConcurrencyDebug 1