views:

278

answers:

2

Can anybody explain to me the cause of the following message, perhaps along with suggestions as to how to fix it?

I'm running XCode under root using sudo <path to xcode because I need to debug a daemon that has to run as root.

I've done this several times successfully, but now when I try to open the project in Xcode I get the following message from XCode:

2009-06-09 10:04:25.521 Xcode[434:a0b] index is corrupt, will rebuild
Segmentation fault

Other projects open fine, and this project opens fine in a non-root instance of Xcode.

I've tried restarting the computer and deleting all of root's pbxuser files etc from inside the project.

Also, if now I go in and try to rebuild the index in Xcode running under my own user I get the following assertion failure. If I hit continue Xcode crashes.

ASSERTION FAILURE in /SourceCache/DevToolsBase/DevToolsBase-1114/pbxindex/PBXProjectIndex.m:305
Details:  NULL symbol vector with value 278024
Function: _symbolKeyForValue
A: 

The solution to this is to completely remove Xcode's current index, which is in the build folder of the project. So delete the entire build folder and then reopen the project and it should be fixed.

Lawrence Johnston
A: 

For those still looking for the answer to this issue, it might be easier to follow these instructions from Andrew Pontious:

Open Xcode, go to its preferences, then Code Sense, and uncheck "Enable indexing for all projects". Press the Apply button in the prefs window.

Once that's turned off, open your project. It shouldn't crash anymore. Then, go back to the preferences, and turn indexing back on. (Click Apply.) Again, it shouldn't crash, but it should completely reindex your project.

Re-enabling indexing made Xcode (3.1.3) crash again for my project, so I have left it disabled.

I actually tried those and also encountered the re-enabling indexing makes it crash again issue. The accepted answer completely solved the crashing issue for me even with indexing enabled.
Lawrence Johnston