Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
- Subject: Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
- From: Michael Crawford <email@hidden>
- Date: Fri, 23 Jan 2015 12:36:59 -0800
perhaps the bug occurred somewhere else and either corrupted the heap
or wrote an erroneous value into some data structure, with the
eventual result that you jumped off into hyperspace, then ran along
just fine until a method was called with parameters that were suitably
invalid as to cause a crash.
If you haven't already tried it, enable Guard Malloc and friends in
your build. Also put some logging into the build you send your user -
hopefully they will be cool with running an instrumented build. In my
experience, most end-users are quite excited to get in on development.
Put assertions everywhere. Again in my own experience, I get the
greatest yield with least effort by validating the input parameters to
everything. While it does help to assert elsewhere, in general most
things that can be asserted ultimately wind up as input parameters
somewhere:
assert() is the Documentation that Keeps On Testing
http://www.warplife.com/tips/code/quality/test/assertion/
I'll send you my bill in the mail. :-D
Mike
Michael David Crawford, Consulting Software Engineer
email@hidden
http://www.warplife.com/mdc/
Available for Software Development in the Portland, Oregon Metropolitan
Area.
On Fri, Jan 23, 2015 at 12:25 PM, Steve Mills <email@hidden> wrote:
> On Jan 23, 2015, at 14:18:38, Jerry Krinock <email@hidden> wrote:
>>
>> Thank you, Steve. Oh, there isn't any. It is only my app, as in MyApp, which implements that command. I made it up. :)
>
> Oh duh. That would explain why 1 of the 3 search results is at sheepsystems.com. :)
>
>> Indeed. The way I'm using -[NSAppleScript executeAndReturnError:] is, as far as I can see, 100% perfect Cocoa and it works fine on my Mac. The crash report is a paradox of some kind.
>
> If "present last logged error" puts up a dialog, could there be some conflict between run loops, autorelease pools being emptied (I recall many problems with this happening in non-ARC apps I've worked on), etc? It wouldn't even have to put up a dialog - just responding to an Apple Event could be enough for the run loop to drain its pools.
>
> --
> Steve Mills
> Drummer, Mac geek
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden