Skip to content

Regression: AOT filter_input(INPUT_GET) follows live $_GET — Zend CLI NULL (re-#19640, ext/filter/filter.c) #33946

Closed

Description

@PurHur

Category

Regression · php-src-strict · AOT filter · pillar 4 (Correctness)

Problem

VM fix for #19640 made filter_input() / filter_has_var() read request-input snapshots (php-src IF_G), so CLI with no request returns NULL even after $_GET['x']='42'. Thin AOT still lowers via filterFromSuperglobal → live sg_GET (ext/filter/filter_input.php), so runtime writes are visible — silent wrong output.

Repro Zend 8.2+ / VM AOT (master @ current)
$_GET['x']='42'; var_export(filter_input(INPUT_GET,'x',FILTER_VALIDATE_INT)); NULL 42
CGI --GET-- x=42 then $_GET['x']='99'; filter_input(...) 42 then 42 42 then 99

test/compliance/cases/stdlib/filter_input_request_snapshot.phpt covers VM; JITTest still skips (MCJIT still reads live sg_*).

php-src reference

PHP implementation target

  • ext/standard/JitSuperglobalRefreshKernel.php — after refresh populates sg_GET/sg_POST/sg_COOKIE, deep-copy into if_* IF_G globals
  • ext/filter/filter_input.php / filter_has_var.php — JIT/AOT read if_* not live sg_* for GET/POST/COOKIE
  • No new runtime/*.c

Repro

./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/fi.bin test/repro/issue_NNNN_filter_input_aot_snapshot.php && /tmp/fi.bin'

Done when

  • CLI AOT matches Zend (NULL / NULL / false)
  • CGI AOT immutable snapshot matches Zend (42 / 42 / '99')
  • ./script/aot-smoke.sh stays 8/8
  • Repro + unit/compliance guard

Parent

Activity

  1. added
    bugSomething isn't working
    phase-3:aotPhase 3 – AOT deployment
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 22, 2026
  2. PurHur commented on Aug 22, 2026

    @PurHur
    OwnerAuthor

    claim: I/O-crypto-text lane — AOT filter_input still reads live sg_GET (re-#19640); IF_G if_* snapshot on __superglobals__refresh + filter_input/filter_has_var load.

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

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-3:aotPhase 3 – AOT deployment

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions