4

When I attempt to archive a build, xcode hangs with the colorful spinny wheel of death. It used to work fine, but I can no longer browse the archive anymore unless I delete the archive files manually. I can build to a device fine without problems though. I deleted all content from the archives manually (by deleting the actual archive files) and the archive/organizer pane shows fine, because nothing is in it (because I deleted the archives). But when I attempt to archive again, it builds, then attempts to open the archive/organizer window again, and it hangs. The archive file it does produce though is about a 30 meg archive file... But I'm afraid to use it..

While the spinny wheel of death is spinning, opening "Activity Monitor" shows the following: "xcodebuild" has about 80% CPU usage "opendirectoryd" has about 30% CPU usage.

I have uninstalled and reinstalled XCode 4.3.2 on Lion with no results.

I'm also building projects from Unity3D..

Someone mentioned the following in a different thread: "I had similar problems I found that a symbolic link I did was the cause of the problem from /Developer/usr/bin to /usr/bin (because Xcode 4.3 moved some of the execs)"

I have nothing like this going on. And moving all of the classes to a new "project" doesn't help because the project is created brand new each time when I build from within Unity.

XCode 4.3.2 Mac OS X (10.7.3)

Any ideas or suggestions would be very helpful to me. Anything at all. Thanks.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
Todd
  • 305
  • 2
  • 9

1 Answers1

5

Quick Solution: execute the following: xcode-select -switch /Applications/Xcode.app/Contents/Developer/

How I came to the solution:

Turned on opendirectoryd debug logging: "odutil set log debug"

Searched around inside the /var/logs/opendirectoryd.log files.

I kept seeing this block of logs spammed over and over again:


2012-04-12 11:29:28.420 CDT - 31053.1185984, Module: SystemCache - Signaling semaphores for more work

2012-04-12 11:29:28.420 CDT - 31053.1185984, Module: SystemCache - Finalizing response object 0x7fae5b21acb0, request is complete

2012-04-12 11:29:28.420 CDT - 31053 - Client: 'xcodebuild', exited with 0 session(s), 0 node(s) and 0 active request(s)

2012-04-12 11:29:28.421 CDT - Trigger - new node trigger watching for 'opendirectoryd:nodes;(register|unregister);.*'

2012-04-12 11:29:28.421 CDT - semaphore_wait will wait - maximum number of membership calls are already in flight

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Client: xcodebuild, UID: 501, EUID: 501, GID: 20, EGID: 20

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Adding to global request list - new count 1

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - mbr_identifier_to_uuid request, UID: 501

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - semaphore_wait will wait - max_active_work

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - semaphore_wait will wait - workq

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Submitting to pipeline

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - executing request pipeline

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Cache hit - dev14 (0x59574CC0)

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Submitting to response pipeline

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - executing response pipeline - 0x10ba2f670

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - mbr_identifier_to_uuid completed, delivered 1 result

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Removing from global request list

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Signaling semaphores for more work

2012-04-12 11:29:28.421 CDT - 31053.1185985, Module: SystemCache - Finalizing response object 0x10ba2f670, request is complete

2012-04-12 11:29:28.421 CDT - 31053 - Client: 'xcodebuild', exited with 0 session(s), 0 node(s) and 0 active request(s)

2012-04-12 11:29:28.422 CDT - Trigger - new node trigger watching for 'opendirectoryd:nodes;(register|unregister);.*'

2012-04-12 11:29:28.422 CDT - semaphore_wait will wait - maximum number of membership calls are already in flight

2012-04-12 11:29:28.422 CDT - 31053.1185986, Module: SystemCache - Client: xcodebuild, UID: 501, EUID: 501, GID: 20, EGID: 20

2012-04-12 11:29:28.422 CDT - 31053.1185986, Module: SystemCache - Adding to global request list - new count 1

2012-04-12 11:29:28.422 CDT - 31053.1185986, Module: SystemCache - mbr_identifier_to_uuid request, UID: 501

2012-04-12 11:29:28.422 CDT - 31053.1185986, Module: SystemCache - semaphore_wait will wait - max_active_work

2012-04-12 11:29:28.422 CDT - 31053.1185986, Module: SystemCache - semaphore_wait will wait - workq

I searched for one of these strings in google and came up with the following solution hidden away on apple's developer forum:

"It seems that the old xcodebuild command was left lying around by the new Xcode installer. After executing 'xcode-select -switch /Applications/Xcode.app/Contents/Developer/' and a 'make clean' the project built perfectly."

Indeed, it works now. Must have been some weird symbolic link that wasn't correct. Lots of other people seem to have issues with opendirectoryd and a broken sym link causing a large CPU spike.

Todd
  • 305
  • 2
  • 9