Repository navigation
Conversation
| /* Move the child's GC sequence forward without requesting new entropy. */ | ||
| php_random_pcgoneseq128xslrr64_advance(PS(random).state, 1); |
There was a problem hiding this comment.
No, this does not work: This will advance the RNG’s state by the same amount for each child - without touching the parent state. As a result, each of the childs will have the same state.
And even if that worked, advancing by 1 means that the childs would immediately catch up with each other.
There was a problem hiding this comment.
I believe I've done. Now each child advances the PCG by a large distance derived from its own PID, without changing the parent's state or requesting new entropy.
There was a problem hiding this comment.
Not great, but it should work indeed.
|
The latest revision advances each child RNG state by a PID-derived distance without reseeding or changing the parent state. The reviewer confirmed this should work; all CI checks are green. |
arnaud-lb
left a comment
There was a problem hiding this comment.
Life cycles look ok: the seed is initialized once per thread from a CSPRNG, and advanced after a fork.
Please add new macros to declare and refer to the child init function, as we do for other hooks.
9be2801 to
3d46385
Compare
|
Addressed the review by adding macros to declare and reference child-init hooks. Fixed CI build failures by replacing obsolete atomic-store calls in zend_test; checks are rerunning. |
|
Fixed the CI build failures by restoring the missing generated arginfo entries for both zend_test functions. The CI checks are running again. |
Fixes #22616 by adding per-extension child initialization hooks and invalidating inherited session GC randomness after forks. Validated with debug NTS and ZTS builds, shared extensions, nested forks, FPM worker recycling, and unavailable entropy sources.