Menu

#988 AppleScript terminology bug?

Other
closed-invalid
nobody
None
5
2014-04-11
2014-04-11
No

For years I've been getting bug reports from Aquamacs users that report a crash when executing an AppleScript from Aquamacs, communicating with Skim.

The crash always happens in AdvanceToSubTerms(), and I have mostly worked on ensuring that a script is provided in a properly allocated chunk of memory.

However, looking at the call stack, I'm seeing that this occurs in GetAppTerminology(), and I am now wondering whether this may be some sort of problem with the way Skim publishes its terminology.

Is there, or was there (in a previous version) a bug where app terminology becomes unavailable to the system? Such as terminology being published via a string, and the string object being released prematurely?

(I don't know if you're publishing it this way, or if there is just some .plist or .xml.)

I thought it's worth asking.

I do not know the version of Skim that these users use, but I sure have a lot of these bug reports.

Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000102800002

VM Regions Near 0x102800002:
MALLOC_SMALL 0000000102000000-0000000102800000 [ 8192K] rw-/rwx SM=COW
--> STACK GUARD 0000000102800000-0000000102801000 [ 4K] ---/rwx SM=NUL stack guard for thread 3
Stack 0000000102801000-0000000102883000 [ 520K] rw-/rwx SM=COW thread 3

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8d1b9292 kill + 10
1 org.gnu.Aquamacs 0x00000001000ac421 terminate_due_to_signal + 145
2 org.gnu.Aquamacs 0x00000001000c90a3 emacs_abort + 19
3 org.gnu.Aquamacs 0x00000001001966db ns_term_shutdown + 123
4 org.gnu.Aquamacs 0x00000001000ac620 shut_down_emacs + 288
5 org.gnu.Aquamacs 0x00000001000ac3e7 terminate_due_to_signal + 87
6 org.gnu.Aquamacs 0x00000001000ca986 deliver_fatal_thread_signal + 134
7 libsystem_platform.dylib 0x00007fff96fcd5aa _sigtramp + 26
8 com.apple.applescript 0x0000000108d49078 TTermEntry::AdvanceToSubTerms() + 88
9 com.apple.applescript 0x0000000108d49492 TTermEntry::NextSubTerm() + 22
10 com.apple.applescript 0x0000000108d4925c TTermEntry::FindSubTerm(TTermEntry&, TTermEntry) + 232
11 com.apple.applescript 0x0000000108d49fd4 TTermEntry::StoreTerm(TTerminology
, TTermEntry, TTermEntry) + 132
12 com.apple.applescript 0x0000000108d49cf7 TTermEntry::ScanNode(TTerminology, _xmlNode const, TTermEntry, sdef::typecode_map const&) + 835
13 com.apple.applescript 0x0000000108d49928 TTermEntry::ScanSubNodes(TTerminology
, _xmlNode const, char const, TTermEntry, TTermKind, sdef::typecode_map const&) + 402
14 com.apple.applescript 0x0000000108d4ab24 TTermEntry::DoSubNodes(TTerminology
, _xmlNode const, TTermEntry, sdef::typecode_map const&) + 176
15 com.apple.applescript 0x0000000108d49ef7 TTermEntry::ScanNode(TTerminology, _xmlNode const, TTermEntry*, sdef::typecode_map const&) + 1347
16 com.apple.applescript 0x0000000108d4d34b TTerminology::ScanScriptingDefinition(
CFData const) + 1047
17 com.apple.applescript 0x0000000108d4cacf GetAppTerminology(TUASApplication const
, __CFURL const) + 1405
18 com.apple.applescript 0x0000000108d57211 TUASApplication::Terminology() const + 117
19 com.apple.applescript 0x0000000108d44fd7 UASStartTellScope1(TUASCommand
) + 545
20 com.apple.applescript 0x0000000108d35e10 ReductionProc + 398
21 com.apple.applescript 0x0000000108d457cd TASParser::Parse(TTerminology, TUASValue, char const, unsigned long) + 1191
22 com.apple.applescript 0x0000000108d2d7d1 ASCompile(AEDesc const
, int, unsigned int) + 450
23 com.apple.applescript 0x0000000108d2830d AppleScriptComponent + 845
24 com.apple.applescript 0x0000000108d42523 AGenericCall::Delegate(ComponentInstanceRecord
) + 37
25 com.apple.applescript 0x0000000108d424e9 AGenericManager::HandleOSACall(ComponentParameters*) + 57
26 com.apple.applescript 0x0000000108d41af8 GenericComponent + 104
27 com.apple.openscripting 0x00007fff8f2b81b2 OSACompile + 60
28 com.apple.Foundation 0x00007fff8db807c0 -[NSAppleScript compileAndReturnError:] + 142
29 com.apple.Foundation 0x00007fff8db80aa8 -[NSAppleScript(NSPrivate) _executeWithMode:andReturnError:] + 69
30 org.gnu.Aquamacs 0x00000001001adf86 ns_run_ascript + 134

Discussion

  • Christiaan Hofman

    I don't know of any bug, never had any problems and never had any report. Moreover, the terminology is publicized using a standard sdef file, i.e. just xml. Not through any programmatic communication. Whatever this is, it is most definitely an AppleScript bug, because even if there would be a bug in the sdef (which I doubt) it certainly should not lead to a crasher. The crasher is in the code that interprets the sdef, not in the sdef itself.

     
  • Christiaan Hofman

    • status: unread --> closed-invalid
     

Log in to post a comment.