This repository was archived by the owner on Oct 30, 2026. It is now read-only.
Repository navigation
Stop checkra1n when palera1n is abandoned - #8
Merged
henrikklee merged 1 commit intoOct 29, 2026
Merged
Conversation
palera1n posix_spawns checkra1n and only waits for it. When the Pongo bootstrap timed out, subprocess.run killed palera1n alone; checkra1n kept running and re-exploited the next device that entered DFU, so a later `orchard launch` found Pongo where it expected DFU. Run palera1n in its own process group and kill the whole group when Orchard stops waiting for it (timeout or interrupt). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
henrikklee
pushed a commit
that referenced
this pull request
Oct 29, 2026
#8 ran the install/launch Pongo bootstrap in its own process group, but `orchard run` has a separate palera1n call that still used subprocess.run. When it timed out, checkra1n kept running and would exploit the next DFU entry. Use run_process_group there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
apple/boot.pyrunspalera1n -p -k <pongo>withsubprocess.run(..., timeout=120). When that times out, Python SIGKILLs palera1n, but palera1n isn't the process doing the work. Itposix_spawns checkra1n and onlywaitpids on it, so checkra1n survives as an orphan. It keeps writing to Orchard's palera1n log, and after each checkm8 timeout it waits for DFU again (Device reconnected in DFU mode, starting over).I hit this on an iPad 6 (J71b) with a Linux host. One install attempt timed out at 20:58 because the cable wasn't replugged in time. That
palera1n-*.logkept growing until 21:16. During that time, every DFU entry (21:14:08, 21:14:54, 21:15:50) was exploited again by the orphan. The last one booted Pongo, so the nextorchard launchfailed with:To anyone running Orchard, the device just seems to leave DFU on its own.
Change
run_process_group()replacessubprocess.run(check=True)for the bootstrap. It starts palera1n withstart_new_session=Trueand, if Orchard stops waiting for any reason (timeout orKeyboardInterrupt), SIGKILLs the whole process group, checkra1n included, before re-raising. The success and non-zero-exit paths behave as before (CalledProcessError), and so does theRuntimeError('... outcome unknown ...')wrapping and the no-retry policy.Testing
test_bootstrap_timeout_stops_spawned_childrenruns a stand-in for palera1n that backgrounds a long-lived child, then checks that the child is gone after the timeout. The same scenario with plainsubprocess.run(timeout=...)leaves the child running, which I checked separately. The test passed 25 out of 25 runs.test_bootstrap_failure_is_reportedcovers non-zero exit and success.test_adapter_boot_sequence_timeouts_and_no_retry_are_preservednow mocksrun_process_groupinstead ofsubprocess.run. I couldn't run it locally: my venv'sorchard_hardware0.1.10 has noprofiles, which fails with or without this change.Not covered here: if Orchard itself is killed with SIGTERM, the Python handlers never run, so palera1n's group can still be left behind.
🤖 Generated with Claude Code