XCode 13.3 crash

Hi, Xcode 13.3 crash systematically on open project.

I have MacOS 12.2.1 and no problems with previous Xcode version.

Any suggestions?

This is the error:

Translated Report (Full Report Below)

Process: XCBBuildService [33983] Path: /Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/MacOS/XCBBuildService Identifier: com.apple.dt.XCBBuildService Version: 13.3 (20080) Build Info: XCBuild-20080000000000000~7 (13E113) Code Type: X86-64 (Native) Parent Process: Xcode [33971] Responsible: Xcode [33971] User ID: 501

Date/Time: 2022-03-16 08:37:08.8507 +0100 OS Version: macOS 12.2.1 (21D62) Report Version: 12 Bridge OS Version: 6.2 (19P744) Anonymous UUID: B5DD29A8-D1D5-0EE3-A47A-F52B4DFAFB8B

Sleep/Wake UUID: 578D934F-E44E-46D3-B5B1-C5F1D4921385

Time Awake Since Boot: 3400 seconds Time Since Wake: 538 seconds

System Integrity Protection: enabled

Crashed Thread: 2 Dispatch queue: XCBBuildSystem.BuildManager.buildQueue

Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: Namespace SIGNAL, Code 4 Illegal instruction: 4 Terminating Process: exc handler [33983]

Does it crash when you create a new project ?

When exactly does it crash ?

Have you imported external frameworks ?

I tested Xcode 13.3 on MacOS 12.3) and opened, compiled, ran a project.

Just had a problem when quitting Xcode (did not quit, but that occurs sometimes with other versions) and when running the app a second time (unable to run without attached code message. I had 2 simulators opened…). I had to quit Xcode and simulator and run again

Does it crash when you create a new project ? No

When exactly does it crash ? on file indexing

Have you imported external frameworks ? Yes

Fixed!

I have two Xcode version installed : 13.2.1 and 13.3,

so I have to run:

sudo xcode-select --switch /Applications/Xcode versione you want to use.app/Contents/Developer

before building (because swift version is different)

Xcode 13.3 is very flakey here. Crashes on almost every 2nd start of a build:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib                   0x1908999b8 __pthread_kill + 8
1   libsystem_pthread.dylib                  0x1908cceb0 pthread_kill + 288
2   libsystem_c.dylib                        0x19080a314 abort + 164
3   libswiftCore.dylib                       0x19dc86830 swift::fatalError(unsigned int, char const*, ...) + 60
4   libswiftCore.dylib                       0x19dc86988 swift::swift_abortRetainUnowned(void const*) + 36
5   libswiftCore.dylib                       0x19dcc9598 swift_unknownObjectUnownedLoadStrong + 76
6   IDESwiftPackageCore                      0x2c088fc54 specialized IDESwiftPackageBuildable.prebuildOperations(forBuildCommand:parameters:logRecorder:) + 100
7   IDESwiftPackageCore                      0x2c0885e40 @objc IDESwiftPackageBuildable.prebuildOperations(forBuildCommand:parameters:logRecorder:) + 88
8   IDEFoundation                            0x101367548 -[IDEBuildOperation start] + 4300
9   Foundation                               0x19188c914 __NSThreadPerformPerform + 212

I am having the exact same issue. First build works. Second build crashes with the identical crash log as posted by DrMickeyLauer. My project is an executable package. I ended up starting over and copying all the files and the package.swift files over. Now, things seem to work just fine?? This is odd given how simple a Swift package is. My only thought is that something in the DerivedData is causing all sorts of problem but I though a clean build would clear those things out in the original package... it did not.

My package does have local dependencies (e.g., "file:///Users/etc..") which I know have caused issues in past versions of Xcode. But I copied these dependencies into the new package.swift file verbatim and no issues. It's a bit weird.

FYI: I tried clearing package caches, etc numerous times without any success.

Same problem here.

First build is fine.

Starting second build we get crash reports (see attachment) on XCBBuildService. After that, we get weird "Cycling Dependency" compiler errors (on dependencies that do not depend on each other). Cleaning the project makes it work but things re-start after the first build!

Problem only since 13.3. 13.2.1 is totally fine.

Run into that exact issue on my end here. It crashes on second builds most of the time. A totally fresh install (with all traces of Xcode removed) doesn't help either. Didn't see such crashes on 13.2.1

We'd appreciate getting some bug reports on this with the full crash reports and an Xcode sysdiagnose attached. Please post the FB numbers here.

I am also getting a similar repeating crash. When I add or create files to my local swift packages, Xcode constantly crashes with the following: Fatal error: Attempted to read an unowned reference but the object was already deallocated.

Typically the crash happens on saving the newly created file, and building. From the stack trace, it looks like the error is happening in the IDESwiftPackageBuildable.prebuildOperations. So any action that triggers a prebuild probably is causing the crash.

Once the crashing starts, it will keep crashing until I clean build.

Filed bug here: FB9989812

Same crash. I have tested with two local SPM packages with dependency A -> B. When I add new file in A it causes the crash with same log.

XCode 13.3 crash
 
 
Q