Skip to content

Fix macOS Ansible worker crashes from ObjC fork safety#204

Merged
l50 merged 2 commits into
mainfrom
fix/macos-objc-fork-safety
May 15, 2026
Merged

Fix macOS Ansible worker crashes from ObjC fork safety#204
l50 merged 2 commits into
mainfrom
fix/macos-objc-fork-safety

Conversation

@mkultraWasHere
Copy link
Copy Markdown
Contributor

Ansible workers crash immediately on macOS with Python 3.14, aborting every playbook at the "Gathering Facts" stage with +[NSNumber initialize] may have been in progress in another thread when fork() was called.

Fixed

  • Ansible playbooks no longer crash on macOS with "A worker was found in a dead state" caused by the ObjC runtime killing forked Python processes during class initialisation
  • OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES is now injected automatically into the Ansible subprocess environment on Darwin, so users don't need to export it manually

On macOS with Python 3.14, the ObjC runtime aborts forked child
processes when class initialisation (+[NSNumber initialize]) is in
progress at fork time. This causes Ansible worker processes to crash
with "A worker was found in a dead state" on every playbook run.

Setting OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES in the Ansible
subprocess environment prevents the crash.
@l50 l50 force-pushed the fix/macos-objc-fork-safety branch from ff23f12 to 1a20847 Compare May 15, 2026 21:13
@l50 l50 merged commit b58a7b4 into main May 15, 2026
9 checks passed
@l50 l50 deleted the fix/macos-objc-fork-safety branch May 15, 2026 21:45
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