63

Hey all basically what the title says, I was working on my project with no issues and then all of the sudden it just stopped compiling. The only thing that led up to this was one of my .m files turned red when I accidentally renamed it and I had to delete it and replace it but that was it. I searched around and can confirm it is not my Bundle Id that is causing the issue. I also ran it with llvm-gcc and got this 'llvm-gcc-4.2 failed with exit code 1' and help? Thanks!

ETA: This is also what it says in the little error box:

clang: error: unable to execute command: posix_spawn failed: Resource temporarily unavailable clang: error: clang frontend command failed due to signal 1 (use -v to see invocation) Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 255

3
  • Do you use posix_spawn functions in your code? Commented Nov 5, 2011 at 22:22
  • I've never used anything called that, what exactly would those functions entail? Commented Nov 5, 2011 at 22:30
  • I had the same issue after renaming. the real reason was that I was changing the class to be used in a static context, rather than as an object. And I was accessing ivars from static methods. Commented Jul 15, 2012 at 16:01

9 Answers 9

195

I just had that same error, same situation(the code worked totally fine, then suddenly has that error message). For me I just closed the simulator and opened it again then xCode does not complain anymore.

Have you tried to run your code in device?

Sign up to request clarification or add additional context in comments.

3 Comments

me too. restarting the simulator fixes this.
Actually rebooting Mac will fix the issue. I had similar problem when running on simulator and then also on device. restarting simulator an device fixed issue temporarily. Then I rebooted Mac and everything started working fine and faster.
rebooted mac, cleaned build & folder... then was fine!
67

This is happening because your OS X install is running into the per-user process limit. And that's happening because XCode doesn't always cleanly kill your process at the end of a debugging session.

On my machine, I have 709 processes allowed per user:

El Smeg:~$ sysctl kern.maxprocperuid
kern.maxprocperuid: 709

Looking at the number of zombied processes on my machine:

El Smeg:~$ ps aux | grep \(GridView\) | wc -l
 608

So you can see that I'm pretty close to the per-user process limit just due to XCode leaving zombie processes around.

Unfortunately, I don't see a good way to kill these off. kill -9 doesn't work. Rebooting seems to be the only fix aside from temporarily raising your per-process limit, which isn't really a fix. You can't kill the parent process because that's launchd and killing that is pretty much equivalent to a reboot anyway.

3 Comments

There is no way to kill a zombie process. That's by definition. At least on Linux, I take it it's the same on Darwin.
Great answer - for those who are a bit slow like me replace the 'GridView' in the ps aux grep with your project name. I got 558 zombies. But my machine has been up for 39 days, so due a reboot I guess.
I have only 1 zombie process for my Project, still it's giving the same error. Looks like something related to longer paths!
21

For me, I just had to reboot (OS X 10.7, Xcode 4.5).

1 Comment

None of the usual suspects worked for me. Rebooting xcode, cleaning, removing the DerivedData. Reboot cleared it up immediately.
2

Roboot your MAC, Launch xcode and before doing anything clean up your project (cmd+shift+k).

Comments

2

I have had this a few times. The simplest way I have found to fix it is just to close the simulator.

Comments

2

maybe this could be useful to someone.

I had the same problem, and it is just because I compile with make -j.

As you know, this causes make to use as many threads as possible, and I think one of these threads was using a ressource when another one tried to access it.

Let make -j compile until the error, it will end automatically, and then just do make.

It should work normally.

Of course, you can just compile with makefrom the beginning, but it will be longer.

Comments

1

I tried it with Xcode 11 beta and its not work, I changed the build configuration to Release and its works like a charm. Project---> Edit scheme----> Run ---> Build Configuration---> Release

Comments

0

I just ran into this, closing xcode and reopening it did the trick. I am curious now if purge would have done anything.

Comments

0

I did the clean and rebuild, also did "remove the app from the simulator". The problems just did not go away, sometimes it shows up as another compiler error on a xib file (which is a false alarm). Eventually I did reboot the machine and it fixed the problem.

I recall doing the kill Xcode/simulator process in the past, but can not recall the exact situation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.