5 Replies
      Latest reply: Sep 19, 2016 6:22 AM by eskimo RSS
      gecko678 Level 1 Level 1 (0 points)

        A day ago I had a perfectly functioning app that run smoothly. I edited few lines of code mostly if statements and hit the run button. It came up with an error, "command failed due to signal: segmentation fault: 11". I have been looking on the internet for fixes for this but I haven't found any. Any help would be great.

         

        Thanks,

        gecko678

        • Re: command failed due to signal: segmentation fault: 11
          QuinceyMorris Level 6 Level 6 (2,445 points)

          This is not your app crashing, but the Swift compiler is crashing.

           

          Try it again with the just-released Xcode 7.3.1 to get the latest Swift compiler version. If it still crashes, submit a bug report with the project that causes it.

           

          If you're lucky, you can try commenting code to find the particular construct that's causing the crash, and try reworking it into a different form that the compiler doesn't choke on.

          • Re: command failed due to signal: segmentation fault: 11
            raphh Level 1 Level 1 (0 points)

            I'm experiencing the same problem with Xcode 7.3.1
            Is there a way to fix it?
            Thanks!

              • Re: command failed due to signal: segmentation fault: 11
                eskimo Apple Staff Apple Staff (5,995 points)

                There is not a general way to fix compiler crashes like this.  My recommendations:

                1. upgrade to the latest compiler

                2. if the problem still occurs, file a [bug report][bug], ideally with a project that reproduces the crash

                3. look at the backtrace in the crash to see if it gives you any hints as to what’s going wrong

                4. shuffle your code around to avoid the crash.

                In your case point 1 is interesting because you have two choices:

                • Xcode 8 includes Swift 2.3, which is a minor update that includes compatibility with the latest SDKs.

                • It also includes Swift 3, which is a major language change.

                For minimal disruption you should test with Swift 2.3 to see if that improves things.  If not, things get trickier.  Migrating to Swift 3 is a bunch of work, and there’s no guarantee that it’ll fix any specific crash.

                Share and Enjoy

                Quinn “The Eskimo!”
                Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                let myEmail = "eskimo" + "1" + "@apple.com"