Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
- Subject: Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
- From: Ken Thomases <email@hidden>
- Date: Fri, 23 Jan 2015 19:47:17 -0600
On Jan 23, 2015, at 1:25 PM, Jerry Krinock <email@hidden> wrote:
> Can anyone explain this weird crash report I got from a user and symbolized? The last thing my code does (frame 24 in the call stack below), is to send -[NSAppleScript executeAndReturnError:]. The crash says someone tried to set a *dictionary* object with a nil key. How could I have done that?
>
> OS Version: Mac OS X 10.10.1 (14B25)
> Crashed Thread: 0 Dispatch queue: com.apple.main-thread
> Exception Type: EXC_CRASH (SIGABRT)
> Exception Codes: 0x0000000000000000, 0x0000000000000000
>
> *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: key cannot be nil'
> terminating with uncaught exception of type NSException
> abort() called
>
> 0 CoreFoundation __exceptionPreprocess + 172
> 1 libobjc.A.dylib objc_exception_throw + 43
> 2 CoreFoundation -[__NSDictionaryM setObject:forKey:] + 1174
> 3 Foundation __NSThreadPerformPerform + 293
> 4 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
> 5 CoreFoundation __CFRunLoopDoSources0 + 269
> 6 CoreFoundation __CFRunLoopRun + 927
> 7 CoreFoundation CFRunLoopRunSpecific + 296
> 8 HIToolbox RunCurrentEventLoopInMode + 235
> 9 HIToolbox GetNextEventMatchingMask + 357
> 10 HIToolbox WNEInternal + 149
> 11 AppleScript _Z19AEDefaultActiveProcPv + 157
> 12 AppleScript _Z23InternalComponentActivej + 81
> 13 AppleScript _ZN15TUASApplication4SendEP25TStackFrame_UASRemoteSendP6AEDescS3_hhh + 2974
> 14 AppleScript _Z13UASRemoteSendhhhhhPh + 582
> 15 AppleScript _Z11UASExecute1v + 373
> 16 AppleScript _Z10UASExecuteh + 193
> 17 AppleScript _Z9ASExecutejjiPj + 460
> 18 AppleScript AppleScriptComponent + 737
> 19 AppleScript _ZN12AGenericCall8DelegateEP23ComponentInstanceRecord + 37
> 20 AppleScript _ZN15AGenericManager13HandleOSACallEP19ComponentParameters + 55
> 21 AppleScript GenericComponent + 108
> 22 OpenScripting OSAExecute + 65
> 23 Foundation -[NSAppleScript(NSPrivate) _executeWithMode:andReturnError:] + 131
> 24 MyFramework -[NSAppleScript(SSYThreadSafe) executeSource:error_p:]
It may have nothing directly to do with you executing an Apple Script. While processing the script, the system is running an internal run loop while it waits for a reply. Some run loop source has fired. That run loop source may have nothing to do with the Apple Script. Executing the script simply gave it the opportunity to fire.
It appears to be related to a -performSelectorOnMainThread:… or -performSelector:onThread:… invocation, judging by the presence of __NSThreadPerformPerform in the stack trace. Beyond that, it may be a memory management error, where something was over-released and thus deallocated while there was still a reference to it. Or it may even be that the -performSelector… invocation was for -setObject:forKey: on a dictionary, with a nil argument.
Regards,
Ken
_______________________________________________
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