Skip to content

Don't abort launch on an unreadable open argument#50

Merged
desertkun merged 1 commit into
masterfrom
fix-openfile-decline-stray-args
Jun 9, 2026
Merged

Don't abort launch on an unreadable open argument#50
desertkun merged 1 commit into
masterfrom
fix-openfile-decline-stray-args

Conversation

@morozov

@morozov morozov commented Jun 8, 2026

Copy link
Copy Markdown
Member

On cold launch AppKit routes stray command-line arguments to application:openFile:. Before display_ui_initialised, an argument that is not a readable, identifiable file called fuse_abort(), which dereferences NULL in startup_manager_run_end because the startup manager isn't initialised yet. This declines such arguments (return NO) instead.

Repro: launch with a stray value-bearing option whose argument AppKit treats as a file to open.

open -n fusepb/build/Deployment/FuseX.app --args --gdbserver-enable --machine 48

Unpatched master crashes during launch (48 is routed to openFile:, fails to read, aborts). With the fix the app declines 48 and launches normally.

Crash signature on unpatched master:

EXC_BAD_ACCESS / SIGSEGV at 0x8
  startup_manager_run_end                  startup_manager.c:174
  fuse_end                                 fuse.c:982
  fuse_abort                               fuse.c:1002
  -[FuseController application:openFile:]   FuseController.m
  -[NSApplication _doOpenFile:ok:tryTemp:]
  -[NSApplication finishLaunching]

On cold launch AppKit routes stray command-line arguments to
application:openFile:. An argument that is not a readable, identifiable
file aborted the launch via fuse_abort, which dereferences NULL in
startup_manager_run_end before the startup manager is initialised.
Decline such arguments instead.
@desertkun desertkun merged commit cbf3cd8 into master Jun 9, 2026
2 checks passed
@desertkun desertkun deleted the fix-openfile-decline-stray-args branch June 9, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants