Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode sometimes crashes when I try to debug in iPhone Simulator after I upgrade Xcode6

I am developing an iPhone app and using iPhone Simulator most of the time. When I try to debug one of my project in iPhone Simulator(does not matter what type and OS version) for debugging, Xcode sometimes suddenly crashes.

After this error happens, changing code just one line and recompiling solves crash, but Xcode6 always crashes when I try to debug the project in iPhone Simulator if I don't recompile the project. Then, after continuing programming for a while, same crash happens.

I might found the reason of crash, which is difference of the signing date and last modification date, from an another topic, but I'm not sure how to approach solving it. (The person said because of Xcode5, but It had never happened when I was using Xcode5 on Mavericks though.) Compiling and linking C extension for Python in Xcode for Mac

The workspace of the project has nested several static libraries projects, so I suspected that it's because of editing nested library code, but it was also happened when I editing only main program code.

This crash is not always happen, so hard to solve what is wrong for me. The workspace of the project is kind of huge, so I would like to avoid creating new workspace if it is possible. I really appreciate someone helps.

This is the crash report.

Crashed Thread:  25  Dispatch queue: DBGLLDBLauncher Serial Queue

Exception Type:  EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x00000001359eb000

kernel messages:
-2 sec              CODE SIGNING: cs_invalid_page(0x1359eb000): p=21345[Xcode] final status 0x1000200, denying page sending SIGKILL
-2 sec              CODE SIGNING: process 21345[Xcode]: rejecting invalid page at address 0x1359eb000 from offset 0x1f3e000 in file "**PATH_OF_EXECUTABLE_FILE**" (cs_mtime:1412141335.0 == mtime:1412141335.0) (signed:1 validated:1 tainted:1 wpmapped:0 slid:0)

VM Regions Near 0x1359eb000:
    MALLOC_LARGE           0000000131224000-0000000133aad000 [ 40.5M] rw-/rwx SM=PRV  
--> mapped file            0000000133aad000-0000000136336000 [ 40.5M] r--/rwx SM=COW  
    MALLOC_LARGE           0000000136336000-0000000137690000 [ 19.4M] rw-/rwx SM=PRV 
like image 341
Ambient Occlusion Avatar asked Oct 01 '14 06:10

Ambient Occlusion


People also ask

Do I need Xcode for iOS simulator?

Launching the Simulator, though, always requires opening Xcode and going to Developer Tools. Because the Simulator. app is embedded within the Xcode app bundle, apps like LaunchBar won't find it to index it. LaunchBar, which is my launcher of choice, also ignores aliases, so dragging Simulator.

How do I debug iOS simulator app?

Inspect the page. In the Safari on your Mac, on the Safari menu bar, choose the "Develop" menu. Scroll to the iOS Simulator option. Select the page for debugging.


1 Answers

I started running into this problem recently. Tried without success a range of things to fix it including reinstalling Xcode (as Apple's Crash Reporter dialog suggests), reset the Simulator, clean build, clean DerivedData folder, etc. Getting desperate, I actually studied the crash report.

The clue to fixing it for me lay there:

Thread 24 Crashed:: <DBGLLDBSessionThread (pid=7926)>
...
14  com.apple.dt.dbg.DebuggerLLDB   ... -[DBGLLDBSession _createBreakpointFromFileBreakpoint:] + 254
...

LLDB is trying to create a breakpoint at the time it crashes. So, I deleted all my breakpoints in Xcode before re-running the project in the Simulator and now it works.

(You didn't post enough of your crash report to see what happened in your case, so your mileage may vary.)

like image 150
user2067021 Avatar answered Nov 15 '22 03:11

user2067021