Command failed due to signal: Abort trap: 6

2020-01-28 04:56发布

Since Xcode 7 and Swift 2.0, I get the error above, like in the screenshot shown here:

screenshot of error log

I have no idea where this is coming from, cleaning and deleting derived data didn't work.

Anyone else experiencing this problem?

Project settings:

project settings

Target settings:

target settings

标签: swift xcode
30条回答
贪生不怕死
2楼-- · 2020-01-28 05:24

I resolved this problem with these steps:

  1. ran 'pod deintegrate'

  2. Makesure podfile like this: platform :ios, '8.0' use_frameworks!

  3. ran 'pod install'

查看更多
Ridiculous、
3楼-- · 2020-01-28 05:24

I fixed it by going to Xcode -> Preferences -> Locations -> Set Relative option to Derived Data.

Setting Derived Data

查看更多
你好瞎i
4楼-- · 2020-01-28 05:25

I got this error too on XCode 7 Beta 5. After I clean the build, then I got another error saying one of my class not conforming to the protocol I just changed. After I fix the issue, it builds. The protocol changes I made is to change two parameter type of a method from Int to Int32

查看更多
smile是对你的礼貌
5楼-- · 2020-01-28 05:25

In my case,

The compiler would give me the message:

Incorrect number of arguments passed to called function!
%4 = call %swift.type* @_T015SimplifiedCoder6StructVMa() #1, !dbg !3112
<unknown>:0: error: fatal error encountered during compilation; please
file a bug report with your project and the crash log
<unknown>:0: note: Broken function found, compilation aborted!

but I realized that I missed a default generic parameter:

class Class<K> {
    init<T: Protocol>(_ value: T) where T.Key == K {}
}

protocol Protocol {
    associatedtype Key
    static func getClass<NewKey>(_: NewKey.Type) -> Class<NewKey>
}

struct Struct<K>: Protocol {

    typealias Key = K

    static func getClass<NewKey>(_: NewKey.Type) -> Class<NewKey> {
        let _self = Struct<NewKey>()
        return Class(_self)
    }
}

protocol CanGetClass {
    associatedtype StructType: Protocol
}

extension CanGetClass {
    func getClass<Key>(_: Key.Type) -> Class<Key> {
        return StructType.getClass(Key.self)
    }
}

struct R: CanGetClass {
    typealias StructType = Struct
}

changed:

typealias StructType = Struct

to:

typealias StructType = Struct<Int>

the extension of CanGetClass tried to call getClass on an incomplete type.

查看更多
你好瞎i
6楼-- · 2020-01-28 05:25

I got this error when attempting to run tests. To solve it, I put this script into Terminal:

rm -rf ~/Library/Developer/Xcode/DerivedData

Deleting derived data resolved the issue

查看更多
不美不萌又怎样
7楼-- · 2020-01-28 05:27

I am able to reproduce this simply and consistently with a brand-new project created in Xcode 7.0 beta (7A120f). Note that the problem is likely more broad than the example, but this is 100% reproducible for me by only adding a single line to a new project. This problem also appears to exclusively apply to iOS, not OS X, at least for this example. Have submitted bug report # 21376523 to Apple.

  1. Create a brand-new project in Xcode 7.0 (7A120f). Type is "Game", Language is "Swift", Game Technology is "SceneKit".

  2. Build and run with default settings. Project builds and runs fine in simulator (you will see the default rotating 3D spaceship model).

  3. Add a single SCNVector3 property to GameViewController.swift, like this:

    class GameViewController: UIViewController {  
      var p = SCNVector3Zero  
    

--> Produces "Abort trap: 6". Project will no longer compile.

  1. Change the constant to an empty initializer.

    class GameViewController: UIViewController {  
      var p = SCNVector3()  
    

--> Same problem, "Abort trap: 6"

  1. Remove property, restoring to the clean project state.

--> "Abort trap: 6" is gone, project again compiles and runs.

  1. Change "var" to "let".

    class GameViewController: UIViewController {  
      let p = SCNVector3Zero
    

-- > Compiles and runs.

  1. Change property type to SCNVector4 instead of SCNVector3.

    class GameViewController: UIViewController {  
      var p = SCNVector4Zero
    

-- > Compiles and runs.

EDIT: This problem is fixed in Xcode 7.0 beta-2 (7A121l), if you are getting "Abort trap: 6" due to using a float 3 vector type (such as SCNVector3). From the release notes:

• A compiler crash when calling C or Objective-C functions that take SIMD float3 parameters has been fixed. (21294916)

查看更多
登录 后发表回答