Skip to content

iOS sim: ungraceful recorder kill leaves CoreSimulator host recording lock dangling (code 16 for all later recordings) #2170

Description

@thymikee

Observed repeatedly during #2168 live validation on Xcode's current CoreSimulator: this host allows ONE active simctl recordVideo session at a time, and when a recorder process dies without a graceful detach (SIGKILL to the recorder, e.g. via a generic owned-process kill during recovery, or a stray pkill -9), SimStreamProcessorService keeps the session registered. Every later simctl io <any-sim> recordVideo on the host then fails:

Error starting video recorder: Error Domain=NSPOSIXErrorDomain Code=16 "Resource busy"
NSLocalizedFailureReason=Host recording is already in progress

agent-device surfaces this as record start → UNKNOWN / "simctl recordVideo exited with code 16", with no hint. The lock persists until SimStreamProcessorService is killed (it relaunches on demand) or the CoreSimulator service restarts.

Two consequences for recovery quality:

  1. Screen-recording recovery that kills an orphaned recorder ungracefully can fix one device while leaving the whole HOST unable to record — worth preferring SIGINT (which simctl recordVideo handles as finalize-and-detach) with a grace window before escalating.
  2. The code-16 failure deserves classification and a hint ("another recording is active on this host, or a previous recorder died ungracefully; stop it or restart CoreSimulator's stream service") instead of UNKNOWN.

Repro: start a recording, SIGKILL the recorder process, try simctl io <other-booted-sim> recordVideo → code 16; kill -9 <SimStreamProcessorService pid> clears it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions