Skip to content

Thin AOT: __phpc_setcookie_add link stubs block session Set-Cookie (#1974) #21900

Description

@PurHur

Category

stdlib · php-src-strict · blocks #1974 SessionsWeb AOT execute / deploy smoke

Problem

Thin standalone AOT fills __phpc_setcookie_add / pending-header ABI with no-op *_link_stub bodies (PendingHeadersJitBridge::fillThinAotLinkStubs). session_start() → phpc_session_emit_setcookie calls the stub → no Set-Cookie: PHPSESSID=….

Upgrading stubs to NestedJIT PendingHeadersJitHelper (clear *_link_stub + implement, peer StreamIoRuntime defer-stub upgrade) currently segfaults in PendingHeadersJitHelper::addHeader when reached from session (gdb: addsetcookie → addheader). Bare setcookie() still links the stub (1-byte ret) so it does not exercise the NestedJIT path.

After #21899, session_start() AOT returns true and no longer aborts; cookie emission is the remaining execute gate.

Done when

  • Thin AOT session_start() emits Set-Cookie: PHPSESSID=… under CGI env (GATEWAY_INTERFACE / REQUEST_METHOD)
  • SessionsWebAotExecuteTest green
  • NestedJIT PendingHeaders upgrade does not segfault (fix addHeader / enableHeaderQueue / preg deps)
  • php-src-strict vs Zend for session cookie line

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
printf "%s\n" "<?php" "session_start();" "echo \"ok\\n\";" > /tmp/s.php
php bin/compile.php -o /tmp/s.bin /tmp/s.php
GATEWAY_INTERFACE=CGI/1.1 REQUEST_METHOD=GET /tmp/s.bin
nm -S /tmp/s.bin | grep setcookie_add   # expect real bridge, not 1-byte stub
'

Refs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions