Studio app crashing with remote scripting (Sigbus 10)

The studio app i’m working on at the moment is crashing about half the time when trying to use remote scripting.

There are 2 places it is crashing but this is the most dependable:

set remotemachine to (“eppc://” & remotemachineip & “:3031/”) as string

using terms from application “DEVONthink Pro”
tell application “DEVONThink Pro” of machine remotemachine
set remoteDB to current database
end tell
end using terms from
showstatus1(“Communicated successfully with remote DevonThink Pro.”) of me

This same syntax, btw, is also crashing script editor.

It seems to happen when for some reason it can’t communicate once with the remote server. Then the normal dialog asking you to authenticate does not come up, and the app / script editor just crashes. This is not just DevonThink, it’s also the Finder and System Events, as long as it’s in the same format.

I’d hate to think this app I’ve been working on is useless. Thanks.

In case this means anything to anyone:

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000006

Thread 0 Crashed:
0 com.apple.CoreFoundation 0x9073d378 CFRelease + 92
1 com.apple.AE 0x914ce5b0 EPPCForwardRunLoopSource::doProcessSessionRequestResult() + 568
2 com.apple.CoreFoundation 0x9075da5c __CFRunLoopDoSources0 + 384
3 com.apple.CoreFoundation 0x9075cf8c __CFRunLoopRun + 452
4 com.apple.CoreFoundation 0x9075ca0c CFRunLoopRunSpecific + 268
5 com.apple.AE 0x914c0684 sendToRemote(EventAddress const*, AEDesc const*, AEDesc*, long, long) + 896
6 com.apple.AE 0x914af950 AESendMessage + 736
7 com.apple.AE 0x914af3d4 aeSend + 224
8 com.apple.HIToolbox 0x9323159c AESend + 108
9 com.apple.applescript 0x994ad060 AEDefaultSendProc(AEDesc const*, AEDesc*, long, short, long, unsigned char ()(EventRecord, long*, OpaqueRgnHandle**), unsigned char ()(EventRecord, long, long, AEDesc const*), long) + 16
10 com.apple.openscripting 0x92fbec5c InvokeOSASendUPP + 24
11 com.apple.applescript 0x994ad02c ComponentSend(AEDesc const*, AEDesc*, long, long) + 112
12 com.apple.applescript 0x994e977c TUASApplication::Send(TStackFrame_UASRemoteSend*, AEDesc*, AEDesc*, unsigned char, unsigned char, unsigned char) + 1400
13 com.apple.applescript 0x9950c02c UASRemoteSend(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*) + 368
14 com.apple.applescript 0x995016b4 UASRemoteGetData(TUASObjectAlias*, TUASApplication*, TUASClassIdentifier*, unsigned char*) + 1120
15 com.apple.applescript 0x99519ca8 UASGetDataNoCircularities(unsigned char, TUASClassIdentifier*) + 228
16 com.apple.applescript 0x99519d30 UASGetData(unsigned char, TUASClassIdentifier*) + 52
17 com.apple.applescript 0x994ed984 UASExecute1() + 328
18 com.apple.applescript 0x994cfb28 ASExecuteEvent(AEDesc const*, unsigned long, long, unsigned long*) + 900
19 …ple.CoreServices.CarbonCore 0x90b5a324 CallComponentFunctionCommon + 1112
20 com.apple.applescript 0x994a3718 AppleScriptComponent + 1712
21 …ple.CoreServices.CarbonCore 0x90b59e68 CallComponent + 260
22 com.apple.openscripting 0x92fd388c OSAExecuteEvent + 52
23 com.apple.OSAKit 0x96307200 -[OSAScript executeAppleEvent:error:] + 168
24 com.apple.AppleScriptKit 0x9628c1a0 -[ASKScriptController executeAppleEvent:] + 68
25 com.apple.AppleScriptKit 0x9628196c -[ASKEventHandler processEventForObject:] + 108
26 com.apple.AppKit 0x93722a20 -[NSApplication sendAction:to:from:] + 108
27 com.apple.AppKit 0x93722954 -[NSControl sendAction:to:] + 96
28 com.apple.AppKit 0x93722834 -[NSCell _sendActionFrom:] + 156
29 com.apple.AppKit 0x9373c84c -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1020
30 com.apple.AppKit 0x9373c434 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 564
31 com.apple.AppKit 0x9373be58 -[NSControl mouseDown:] + 536
32 com.apple.AppKit 0x936dd660 -[NSWindow sendEvent:] + 4616
33 com.apple.AppKit 0x936866f4 -[NSApplication sendEvent:] + 4172
34 com.apple.AppKit 0x9367db30 -[NSApplication run] + 508
35 com.apple.AppKit 0x9376e618 NSApplicationMain + 452
36 main.ob 0x00012f88 main + 64 (main.m:8)
37 com.wbc.devonsync 0x0000233c start + 408
38 com.wbc.devonsync 0x000021e0 start + 60

Thread 1:
0 libSystem.B.dylib 0x9000b208 mach_msg_trap + 8
1 libSystem.B.dylib 0x9000b15c mach_msg + 60
2 com.unsanity.ape 0xc0002afc __ape_internal + 3300 (icplusplus.c:28)
3 com.unsanity.ape 0xc0001910 __ape_agent + 64 (icplusplus.c:28)
4 libSystem.B.dylib 0x9002b200 _pthread_body + 96

Thread 2:
0 libSystem.B.dylib 0x9001f20c select + 12
1 com.apple.CoreFoundation 0x9076f99c __CFSocketManager + 472
2 libSystem.B.dylib 0x9002b200 _pthread_body + 96

Thread 0 crashed with PPC Thread State 64:
srr0: 0x000000009073d378 srr1: 0x100000000000f030 vrsave: 0x0000000000000000
cr: 0x24044422 xer: 0x0000000000000000 lr: 0x000000009073d324 ctr: 0x000000009073d31c
r0: 0x00000000914ce5b0 r1: 0x00000000bfffd160 r2: 0x00000000a073d324 r3: 0x0000000000000000
r4: 0x0000000000000000 r5: 0x00000000000003e8 r6: 0xffffffffffffffff r7: 0x0000000000000000
r8: 0x00000000016850c6 r9: 0x0000000000000060 r10: 0x0000000000000001 r11: 0x00000000a14a964c
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000001 r15: 0x0000000000000000
r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x000000000000667f r19: 0x0000000000000000
r20: 0x00000000000000e8 r21: 0x00000000cfa0b8b0 r22: 0x0000000000000001 r23: 0x000000000030f6a0
r24: 0x0000000000000000 r25: 0x000000000030f6a8 r26: 0x0000000001687240 r27: 0x0000000001686140
r28: 0x0000000000000000 r29: 0x0000000000000000 r30: 0x00000000bfffd1b0 r31: 0x000000009073d324