AOT: fix request_parse_body compile/link (#5965)#17316
Open
PurHur wants to merge 4 commits into
Open
Conversation
- Link __compiler_env_register_putenv via EnvLocalRuntime during standalone putenv JIT - Route GetenvJitHelper hashtable fills through phpc_native_ht_set_string_key (nested-JIT safe) - Promote list-unpack assign targets to entry allocas for LLVM dominance (#5965) - Preserve insert blocks across RequestParseBodyRuntime / EnvLocalRuntime nested emits Compile + link green for urlencoded/multipart fixtures; AOT runtime still segfaults at c:main_before_php (follow-up). Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
|
Maintainer triage 2026-07-08: compile/link green per PR body but AOT runtime still segfaults at |
Owner
Author
|
Maintainer triage 2026-07-08: compile/link green per PR body but runtime segfault remains — hold merge until AOT execute passes issue repro. |
This was referenced Jul 8, 2026
- Link EnvLocalRuntime + RequestParseBodyRuntime in user-script standalone init - Route GetenvJitHelper fill/merge through phpc_native_ht_set_string_key (nested-JIT) - Split VM overlay merge into EnvLocalJitHelperVm (HashTable::update path) - Add issue repro scripts for putenv/request_parse_body AOT bisect Compile+link green; AOT execute still segfaults in __compiler_env_register_putenv. Co-authored-by: Cursor <cursoragent@cursor.com>
1 task
- BasicBlockHelper::restoreInsertBlock accepts null during standalone init - JitEnv::putenv calls GetenvJitHelper via JitNestedHelperCoerce (fixes AOT segfault) - RequestParseBodyEngine reads JIT+VM env overlay for CONTENT_TYPE/REQUEST_BODY - Defer RequestParseBodyRuntime from ensureMinimalUserStandaloneBodies (lazy link) - StringGetenv: preserve insert block across bridge emit AOT putenv-only repro green; request_parse_body execute still segfaults on nested helper call (empty parseIntoNative also crashes) — follow-up bisect needed. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
Continued work (2026-07-12, lane C)Pushed Fixed
Verification (Docker)PHP_COMPILER_CI_SINGLE_CONTAINER=0 ./script/docker-exec.sh -- bash -lc '
source script/php-env.sh && export PHP_COMPILER_PROFILE=8.4
php bin/vm.php test/repro/issue_5965_rpb_only.php
tmpdir=$(mktemp -d)
php bin/compile.php -o "$tmpdir/pe" test/repro/issue_5965_putenv_only.php && "$tmpdir/pe"
vendor/bin/phpunit test/unit/JIT/EnvLocalRuntimeStandaloneTest.php
'
Still red (blocker)
Not merge-ready until |
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.
Summary
Continued #5965 — AOT standalone
putenv()compile+execute fixed;request_parse_body()AOT execute still blocked.Root fixes (commit 6fff073):
BasicBlockHelper::restoreInsertBlock(null)— standalone init no longer TypeErrors (Stdlib: request_parse_body() — PHP 8.4 HTTP body parser without superglobals (ext/standard/http.c) #5965)StringGetenv::implementpreserves insert block after bridge emit — fixes "Current basic block has no parent function" on AOT compileJitEnv::putenvroutes standalone throughGetenvJitHelper::putenvviaJitNestedHelperCoerce(avoids__compiler_env_register_putenvsegfault)RequestParseBodyEngine::overlayGetenvreads JIT putenv overlay + libc environ forCONTENT_TYPE/REQUEST_BODYRequestParseBodyRuntimefromensureMinimalUserStandaloneBodies(lazy link on first call)php-src ref:
ext/standard/http.c(request_parse_body),ext/standard/basic_functions.c(putenv/getenv)Verification (2026-07-12, Docker)
Blockers (next run)
request_parse_body()segfaults before user output; VM green. Bisect JITcall()return / nestedRequestParseBodyJitHelperlink.putenvdoes not populate overlay visible to__compiler_getenv; need unified helper path for both or fix register bridge without segfault.Closes #5965 when AOT fixtures
request_parse_body_{urlencoded,multipart}.phpt+putenv.phptexecute green.