Command failed due to signal: Abort trap: 6

前端 未结 30 2642
暖寄归人
暖寄归人 2020-12-01 08:56

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

\"screenshot

30条回答
  •  误落风尘
    2020-12-01 09:44

    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)

提交回复
热议问题