Monday, January 7, 2008

21st Century Errors and Apple Script - redux

OK, it appears to be Apple's bug.

Even the most trivial app exhibits the crashy behaviour (or, at best, the -1700 error about a third of the time).
The problem appears to be with GC. Turn it on (Supported or Required) and you're in Crashville, turn it off and everything is peachy.

Unfortunately (call me a wimp!) there's no way I'd consider working around this issue by converting to a retro non-GC mode for development. I'd like to claim that I've done my time with reference counted memory managers and been let off for good behaviour. In my dotage I rather like the idea of the computer doing something that computers are very good at: keeping track of all the nitty-gritty details of what bits of memory are linked to what and doing the spring cleaning all on its own :-)

Apple bug 5674625 raised, with a simple reproduction case attached (though I bet it's a dup by now - I can't believe there aren't others trying to use NSAppleScript in such a simple way).

Now... maybe I should take the opportunity to learn how to make out-of-proc calls with Cocoa's distributed objects to a little mini-server dedicated to running a single AppleScript contribution and returning the result (or I suppose I could just fork an osascript process!).

No comments: