Skip to content

Fix AOT CGI superglobal refresh: QUERY_STRING populates $_GET (closes #18832) - #18841

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-18832-aot-query-string-refresh
Jul 14, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-18832-aot-query-string-refresh

Conversation

@PurHur

@PurHur PurHur commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Root cause

Under PHP_COMPILER_AOT_USER_SCRIPT=1, nested JIT of ParseStrNativeJitHelper during thin standalone init emits single-block no-op helpers. __compiler_parse_str bridge called those stubs, so $_GET/$_REQUEST stayed empty while $_SERVER['QUERY_STRING'] was set correctly.

Verification

./script/docker-exec.sh -- bash -lc 'php vendor/bin/phpunit test/unit/JIT/SuperglobalsBracketRuntimeStandaloneTest.php test/unit/SuperglobalRefreshRuntimeShrinkTest.php'
# OK (4 tests, 17 assertions)

./script/docker-exec.sh -- bash -lc 'php vendor/bin/phpunit test/aot/RuntimeSuperglobalRefreshTest.php --filter testTwoRequestsDifferentQueryString'
# OK (1 test, 7 assertions)

./script/docker-exec.sh -- bash -lc '
PHPC=/compiler/phpc
$PHPC build -o /tmp/simpleweb /compiler/examples/001-SimpleWeb/example.php
env QUERY_STRING=name=Smoke SCRIPT_NAME=/example.php REQUEST_URI=/example.php?name=Smoke /tmp/simpleweb | grep "<h1>Hello Smoke</h1>"
'
# <h1>Hello Smoke</h1>

Closes #18832

Made with Cursor

…rse LLVM (#18832).

Nested ParseStrNativeJitHelper JIT under PHP_COMPILER_AOT_USER_SCRIPT produces
no-op stubs during thin user-script init (#18643 regression). Restore init-safe
ParseStrUserScriptDelimitedJit and call __phpc_parse_str_parse_delimited_pairs
directly from SuperglobalRefreshUserScriptLlvm for $_GET/$_REQUEST/$_COOKIE.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 7ed8ba1 into master Jul 14, 2026
@PurHur
PurHur deleted the agent/issue-18832-aot-query-string-refresh branch July 14, 2026 09:46
PurHur added a commit that referenced this pull request Jul 14, 2026
…fix (#18847)

ParseStrUserScriptDelimitedJit was restored for init-safe libc C-string
parsing in user-script AOT superglobal refresh; update shrink tests that
still asserted the file was deleted.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Jul 14, 2026
…fault (#18841 follow-up). (#18849)

Nested LLVM parse_key_brackets/set_nested_value crashes on runtime refresh strings;
skipping bracket pairs lets flat keys in mixed queries parse (NestedSuperglobalsAotTest).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Release v1.1.0: fix examples 001-SimpleWeb AOT smoke (QUERY_STRING name=Smoke not parsed)

1 participant