Xcode error: Abort Trap 6

Occasionally, I get this error and I tried to research it but I couldnt figure out how to solve it. It says:


1. While deserializing SIL vtable for 'PostTextCVC' in module 'Appp'
error: Abort trap: 6

The only way to dismiss this is to user another simulator or my actual phone. I don't know how to fix it for real though, don't even know what that error means. It's not exactly descriptive. Any suggestions?


PS: Xcode version 10.0. beta 5

Just to add my experience for anyone finding this thread later – I had a similar non-descriptive "abort trap" error when compiling my own project. In my case, I'd added a possible call to fatalError() in one of my classes' initializers during an experiment – it looks like that was enough to bring it about. Removing that branch was enough to get back to where I was before the error ever showed up.

In my case, I solved it by changing guard else return to if let block of code in for-loop, and this for-loop is in network callback. In brief, I think the compiler doesn't know where to execute from it hit return in guard else. Hope it helps

Encountered this compiler crash when a guard case is followed by a let (FB9643656). E.g.:

let value = CollectionDifference.Change.insert(offset: 1, element: 1, associatedWith: nil)

guard case .insert(_, _, let associatedWith) = value, let associatedWith = associatedWith else { 
    return
}

But splitting the two guarded conditions into separate guard statements solves the issue.

Just encountered this problem.

caused by a guard let unwrapping with the same name as a previous value in the same block, the compiler didn't identify the error.

example :

{
 var mData : String? = Storage.value(key: "mValue")
 guard let mData = mData else {return}
}

Hey, everyone!

I've been trying to fix this issue for months without any success, it just popped up after the new version of xcode was released and I was kinda hopeless.

Fortunately, I've found a workaroud, it goes like this:

  • Choose you target
  • Build settings
  • Optimization Level
  • Debug
  • Optimize for size [-Osize]

It's been working well enough, but it was annoying that I couldn't look up any local variables in build time while debugging. Well, today I finally found the issue and managed to fix it. The code looked like that:

switch item {
case .a(var model), .b(var model), .c(var model):
// cell dequeue here
// model mutation here
// cell configuration here from model
// cell return here
}

The problem of that, I suppose, that we're fetching the mutable models from different cases and mutate them after that (by the way, all models are of the same struct, of course, it is legal to do so). I've changed it like that:

switch item {
case .a(let model), .b(let model), .c(let model):
// cell dequeue here
var configurationModel = model
// configurationModel mutation here
// cell configuration here from configurationModel
// cell return here
}

Hope it could be useful for someone who encountered such unusual behaviour of xcode.

got the same in Xcode 13.2.1 with swiftui I have 3 nested ForEach's. Had to break them up into separate functions for each nested ForEach level

Hey, everyone! I found the solution for this problem, hope it could be useful

  • Select Pods > Build Settings > Swift Compiler - Code Genration > Optimization Level > Debug and Realease make "No Optimization [-Onone]"
  • Select Your Project > Select Targets > Build Settings > Swift Compiler - Code Genration > Optimization Level > Debug and Realease make "No Optimization [-Onone]"

Thank you from VN!

Same issue here. It doesn't happen when building in the simulator. It happens when I am trying to archive the build.

I'm able to reliably reproduce this with the code below. If I comment it out, the Abort trap disappears.

extension DocumentGroup {
  func useDefaultSizeIfAvailable() -> some Scene {
    if #available(macOS 13.0, *) {
      return self.defaultSize(.init(width: 750, height: 750))
    } else {
      return self.windowStyle(.automatic)
    }
  }
}
Xcode error: Abort Trap 6
 
 
Q