Note that there are some explanatory texts on larger screens.

plurals
  1. POXcode 4.4.1 build crashing on Snow Leopard
    text
    copied!<p>I have a project which I am compiling under OS X 10.7.4 using Xcode 4.4.1</p> <p>I am using Base SDK SDKROOT macosx10.7 I have set Deployment Target MACOSX_DEPLOYMENT_TARGET 10.6</p> <p>I tested a recent build on Snow Leopard and it crashed. Previous builds using Xcode 4.2 and 4.3 did work, and I can compile on Snow Leopard using Xcode version 3.2.6</p> <p>Has anyone else had this experience, or better know what I can do to resolve it?</p> <pre><code>OS Version: Mac OS X 10.6.8 (10K549) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000030 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: objc[274]: garbage collection is ON Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 com.apple.AppKit -[NSImage _allocAuxiliaryStorage] + 158 1 com.apple.AppKit -[NSImage copyWithZone:] + 66 2 libobjc.A.dylib objc_setProperty + 82 3 -[TreeViewController(Dirs) outlineView:willDisplayCell:forTableColumn:item:] + 207 </code></pre> <hr> <p><strong>PS Just restored Xcode 4.2.1 from TimeMachine backup and the build works on Snow Leopard</strong> </p> <p>I "upgraded" to Mountain Lion - which would not allow Xcode 4.2.1 to run. (This also seemed to delete the OSX 10.8 and Xcode 4.4 SDK and the command line tools :-( ). This made it impossible to just use the precious compiler.</p> <p>I tried to follow up where the crash was happening, which appeared to be in a call to setNodeIcon which was defined in one of my classes as </p> <pre><code>@property (copy) NSImage *nodeIcon; </code></pre> <p>I realise I will have to convert to ARC eventually, but was reluctant to embark on this yet. The conversion was far from straightforward and I am not sure I understand all the changes I was required to make (one file at a time) in particular the Toll-Free Bridging changes.</p> <p>The resultant ARC code does seem to work on 10.6 - 10.8 but I need to do a lot of regression and leak testing to confirm.</p> <hr> <h2>Updated Comments 2012-09-18</h2> <p>The ARC code works but I found a couple of problems (which I have resolved) but need to do a lot more.</p> <p>I went back to my GC code and changed <code>copy</code> to <code>assign</code>. This seemed to work.</p> <pre><code>@property (assign) NSImage *nodeIcon; </code></pre> <p>Just to confirm I made a standalone app (see below) which does nothing but copy an NSImage. This crashed in the same way, so it seems to be a bug in the compiler.</p> <pre><code>#import &lt;Cocoa/Cocoa.h&gt; @interface AppDelegate : NSObject &lt;NSApplicationDelegate&gt; { NSImage *nodeIcon; } @property (assign) IBOutlet NSWindow *window; @property (copy) NSImage *nodeIcon; @end #import "AppDelegate.h" @implementation AppDelegate @synthesize nodeIcon; - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSString *defaultDirectory = NSHomeDirectory(); [self setNodeIcon:[[NSWorkspace sharedWorkspace] iconForFile:defaultDirectory]]; } @end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload