Category
php-in-php · stdlib · streams / stat (#1492)
Problem
JIT/AOT fstat() and related stream path lookups use lib/JIT/Builtin/StreamPathRuntime.php LLVM that reads phpc_stream_handles[] / phpc_stream_paths[] globals. VM stream opens already record paths in ext/standard/VmFs.php / stream wrappers.
Duplicated path tables mean JIT fstat() can miss paths registered by VM fopen() and drift from php-src php_stream metadata behavior (#6764).
php-src reference
Repro
<?php
$p = sys_get_temp_dir() . '/phpc_stream_path_probe.txt';
file_put_contents($p, 'x');
$h = fopen($p, 'r');
var_export(fstat($h));
fclose($h);
@unlink($p);
./script/docker-exec.sh -- php bin/vm.php repro.php
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php repro.php'
Both must return a populated stat array for the same handle; JIT must not return false when VM succeeds.
Scope (this repo)
| Layer |
Path |
| VM SSOT |
ext/standard/VmFs.php, VmPhpFdStream.php, stream resource metadata |
| LLVM today |
lib/JIT/Builtin/StreamPathRuntime.php, StreamGlobalsJit.php |
| Consumers |
JIT fstat lowering, clearstatcache path keys |
Done when
Related
Category
php-in-php·stdlib· streams / stat (#1492)Problem
JIT/AOT
fstat()and related stream path lookups uselib/JIT/Builtin/StreamPathRuntime.phpLLVM that readsphpc_stream_handles[]/phpc_stream_paths[]globals. VM stream opens already record paths inext/standard/VmFs.php/ stream wrappers.Duplicated path tables mean JIT
fstat()can miss paths registered by VMfopen()and drift from php-srcphp_streammetadata behavior (#6764).php-src reference
ext/standard/streams.c—php_streampath/url metadataext/standard/filestat.c—fstatwrapperRepro
./script/docker-exec.sh -- php bin/vm.php repro.php ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php repro.php'Both must return a populated stat array for the same handle; JIT must not return
falsewhen VM succeeds.Scope (this repo)
ext/standard/VmFs.php,VmPhpFdStream.php, stream resource metadatalib/JIT/Builtin/StreamPathRuntime.php,StreamGlobalsJit.phpfstatlowering,clearstatcachepath keysDone when
VmFs/stream metadata (thin trampoline OK)StreamPathRuntime.phpdeleted or stub; no parallel path globals in LLVM./script/ci-fast.sh --filter fstatgreen (VM + JIT)Related