Crashing only in Xcode 13.0 (EXC_BAD_INSTRUCTION)

Working in latest version of Xcode 12.

When opening a SwiftUI view containing a Core Data list, a crash occurs and execution stops at the first line of the AppDelegate. There is no backtrace info in the console and from what I can see in the backtrace (attached crash.txt), and by stepping through each frame in Xcode, I don't see any code in my app.

Is this a bug? Advice on how to fix? In Xcode 13.0 (only), I cannot view any List. The same code runs as expected in Xcode 12.5

David

  • I'm seeing a similar issue - Xcode 13, view with a core data list. Preview displays the view in run mode but upon selecting I get a crash (EXC_BAD_INSTRUCTION (SIGILL)) with the same errors in crash.txt above. Previewing on device seems to work okay, its just inside Xcode its failing. Not reproducible on 12.5. To confirm, the list does get displayed correctly, but selecting anything causes the same crash.

Add a Comment

Replies

I have the same problem. Works fine on macOS but crashes on iOS. Have you filed a radar?

  • No bug report yet. I've been refactoring the code, trying to determine if I've induced the crash. I have managed to view 1 of 4 similarly coded views containing this List, which puzzles me even more. I am still not sure whether the problem is in my code. Are you using 1) Core Data, and 2) List containing ForEach?

  • Yes, using Core Data with CloudKit and List with ForEach.

    I have a 3 columns app (sidebar, list, detail view). The crash occurs when I select an item in the sidebar, which causes the list to update. Sometimes I'm able to select an item and the list refreshes without crashing but most of the time it does.

Add a Comment

I'm having the same problem, but with a List with the searchable modifier. Clicking on the cancel button or cross button to remove the text causes this.

I am in fact experiencing a similar problem in Xcode 13 when trying to delete the last item from a filtered list containing a ForEach on Core Data elements.

I am getting an "EXC_BREAKPOINT" at the first line of AppDelegate. No issues in Xcode 12 or iOS 14.

FB9158797

  • This crash seems pretty random and occurs in different scenarios. At least it doesn't seem to be something we're doing wrong. Thanks for the radar!

  • I get this too. It happened after some refactoring. The crash happens in SystemListDataSource.contextForItem(index:).

  • The change that triggered this was extracting a Section header / footer into a custom view instead of setting it inline. The view has conditional logic, not sure if that's related.

Add a Comment

I ran some tests and oddly enough in my case the issue is only occurring on my iPad, not my iPhone. Anyone else?

Here's my radar for the issue: FB9188075

I managed to reproduce the crash in a sample project, attached to the radar.

is there any update on this issue?