spawn plan apply: keep the plan's argv[0] — MRI does not re-prepend it (tebako#669) - #121
Merged
Merged
Conversation
tfs_spawn_plan_apply skipped the plan's first token, believing ruby
re-prepends command_abspath as the child's argv[0] at exec. It does
not: the child argv comes from argv_buf verbatim, so the first real
token ("--tebako-image") was consumed as argv[0] and the actual first
mount triple fell out of the flag parse — the spawned runtime booted
with only its env image and the payload mounts were lost (tebako#669's
jing residual: Unable to access jarfile, argv-form spawn only).
Proven by an argv-dump of the spawned store exe: argv[0] was
"--tebako-image". MRI's execv takes the file from command_abspath and
argv[0] from argv_buf's first token — rb_exec_fillarg's exact layout,
which the plan already carries. Delete the skip; keep the full argv.
Applies to every line's neutral patch (3.1-4.0) and the 3.2/3.3/3.4
msys carriers (the windows shell-form surface plans through the same
function).
Verified: tools/apply green for 3.1.7/3.2.11/3.3.12/3.4.10/4.0.6 on
darwin and msys patch selections; applied process.c carries the full
argv and the corrected comment.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
tfs_spawn_plan_applyskipped the plan's first token, on the theory that ruby re-prependscommand_abspathas the child's argv[0] at exec. It does not — the child argv comes fromargv_bufverbatim. The first plan token (--tebako-image) was consumed as argv[0], its mount triple fell out of the flag parse, and the spawned runtime booted with only its env image: the/-mounted payload was unreachable (tebako#669's residual —Jing failed … Unable to access jarfile, argv-form spawn only; shell-form spawns were green on the same runtime).Evidence
An argv-dump substituted for the spawned store exe shows the child's real argv as
["--tebako-image", "<triple>", "--tebako-entry", …]— the plan's tokens shifted by one. MRI's exec path takes the file fromcommand_abspathand argv[0] fromargv_buf's first token (exactlyrb_exec_fillarg's layout — which the driver's plan already carries:[exe, --tebako-image …]).Fix
Delete the apply-side skip;
argv_bufkeeps the plan's full argv. The extraction side (#119: offer only user arguments, never argv[0]) is correct and unchanged. All 8 carriers: neutral patches 3.1/3.2/3.3/3.4/4.0 + the 3.2/3.3/3.4 msys carriers (windows shell-form plans through the same function). The stale comment claiming the re-prepend is corrected in both the patch headers and the function block.Verification
tools/applygreen for 3.1.7 / 3.2.11 / 3.3.12 / 3.4.10 / 4.0.6, darwin + msys selections; appliedprocess.cinspected — skip gone, comment correct. Compile-smoke gate runs in CI.Companion product-side fix: tamatebako/tebako#673 (registry row split) + the driver regression test guarding the
/-mounted-payload triple composition.