SpliceKit icon indicating copy to clipboard operation
SpliceKit copied to clipboard

Crash: timeline.action undo dispatched while a modal dialog is open → EXC_BAD_ACCESS in FFUndoManager (3.3.9)

Open starpixels opened this issue 3 weeks ago • 0 comments

Summary

Calling timeline_action("undo") (RPC timeline.action) while a modal dialog is open crashes Final Cut Pro with EXC_BAD_ACCESS (possible pointer authentication failure) inside -[FFUndoManager undo].

Crash report

Final Cut Pro-2026-11-14-173908.ips, SpliceKit 3.3.9, macOS 26:

Exception: EXC_BAD_ACCESS (SIGSEGV), KERN_INVALID_ADDRESS ... (possible pointer authentication failure)
Thread 0 (com.apple.main-thread):
  objc_msgSend
  -[FFUndoHandler undoableEnd:option:error:]
  -[FFUndoManager undo]
  __SpliceKit_handleTimelineAction_block_invoke.1416
  __SpliceKit_executeOnMainThread_block_invoke
  ...
  -[NSApplication _doModalLoop:peek:]
  __35-[NSApplication runModalForWindow:]_block_invoke_2

Repro context

An FCPXML import had opened FCP's modal "Which library do you want to import into?" sheet. While that modal was up, an MCP client sent timeline.action = undo. SpliceKit dispatched it onto the main thread, which was inside the modal run loop, and FCP's undo manager dereferenced a mangled pointer.

Suggested fix

Guard SpliceKit_handleTimelineAction (and ideally all mutating RPCs) with a modal check — if +[NSApp modalWindow] (or SpliceKit's detect_dialog equivalent) is non-nil, return an error like "a dialog is open; close it first" instead of executing. This also prevents arbitrary edits landing inside modal sessions in general.

starpixels avatar Nov 14 '26 23:11 starpixels