Category
php-in-php · runtime-shrink (#1492 , peer #32110 sprintf / #29531 random_bytes)
Problem
Always-on Builtin\Type still registers libc getrandom(3) (Type::register() addFunction('getrandom')) even though:
User-script random_bytes() already lives in PHP (RandomBytesJitHelper / StringRandomBytes / __compiler_random_bytes) — not this always-on libc row.
NestedJIT JitRandomBytesKernel already reads /dev/urandom via module-local open/read (LibcExtern::ensurePosixFd, php-in-php: drop always-on LibcExtern open/close/read/write after NestedJIT declares module-locally (#31764 shape) #31817 / php-in-php: RandomBytesJitHelper → @random_bytes NestedJIT leaf; delete phpc_random_bytes_kernel (re-#29364 / gethostname) #29531 ). It does not call getrandom(3).
There are zero lookupFunction('getrandom') consumers under lib/ + ext/. The always-on row is dead C surface on every JIT/AOT module.
Path
Today
Target
User-script random_bytes()
PHP helpers (RandomBytesJitHelper / StringRandomBytes)
unchanged
NestedJIT kernel
/dev/urandom via open/read
unchanged
Builtin\Type
always-on libc getrandom
drop declare
VM
VmRandomPure / VmRandomNative (no getrandom FFI, #8921 / #12181 )
unchanged
php-src reference
PHP implementation target
lib/JIT/Builtin/Type.php — drop always-on libc getrandom declare
test/unit/GetrandomRuntimeShrinkTest.php — assert Type no longer addFunction('getrandom'); no NestedJIT lookupFunction('getrandom') remains
Repro
./script/phpunit.sh --filter ' GetrandomRuntimeShrinkTest|StringRandomBytesRuntimeShrinkTest|VmRandomPureRuntimeShrinkTest'
Done when
Category
php-in-php· runtime-shrink (#1492, peer #32110 sprintf / #29531 random_bytes)Problem
Always-on
Builtin\Typestill registers libcgetrandom(3)(Type::register()addFunction('getrandom')) even though:random_bytes()already lives in PHP (RandomBytesJitHelper/StringRandomBytes/__compiler_random_bytes) — not this always-on libc row.JitRandomBytesKernelalready reads/dev/urandomvia module-localopen/read(LibcExtern::ensurePosixFd, php-in-php: drop always-on LibcExtern open/close/read/write after NestedJIT declares module-locally (#31764 shape) #31817 / php-in-php: RandomBytesJitHelper → @random_bytes NestedJIT leaf; delete phpc_random_bytes_kernel (re-#29364 / gethostname) #29531). It does not callgetrandom(3).lookupFunction('getrandom')consumers underlib/+ext/. The always-on row is dead C surface on every JIT/AOT module.RandomBytesJitHelper/StringRandomBytes)/dev/urandomviaopen/readBuiltin\TypegetrandomVmRandomPure/VmRandomNative(no getrandom FFI, #8921 / #12181)php-src reference
ext/standard/random.c—php_random_bytes()(getrandom //dev/urandomfallback)ext/random/random.c—PHP_FUNCTION(random_bytes)PHP implementation target
lib/JIT/Builtin/Type.php— drop always-on libcgetrandomdeclaretest/unit/GetrandomRuntimeShrinkTest.php— assert Type no longeraddFunction('getrandom'); no NestedJITlookupFunction('getrandom')remainsRepro
./script/phpunit.sh --filter 'GetrandomRuntimeShrinkTest|StringRandomBytesRuntimeShrinkTest|VmRandomPureRuntimeShrinkTest'Done when
Builtin\Typehas no always-on libcgetrandomdeclarelookupFunction('getrandom')remainsrandom_bytes()still goes through PHP helpers //dev/urandomkernelrandom_bytes()behavior unchangedexit/abortalways-on decls remain (live consumers)