Repository navigation
Conversation
|
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. |
| zend_module_entry *module; | ||
|
|
||
| refresh_memory_manager(); | ||
| zend_max_execution_timer_init(); | ||
| php_clear_stat_cache(true, NULL, 0); | ||
|
|
||
| ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) { |
There was a problem hiding this comment.
| zend_module_entry *module; | |
| refresh_memory_manager(); | |
| zend_max_execution_timer_init(); | |
| php_clear_stat_cache(true, NULL, 0); | |
| ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) { | |
| refresh_memory_manager(); | |
| zend_max_execution_timer_init(); | |
| php_clear_stat_cache(true, NULL, 0); | |
| ZEND_HASH_MAP_FOREACH_PTR(&module_registry, zend_module_entry *module) { |
17bab85 to
ec720cd
Compare
ec720cd to
ce8ba69
Compare
| #define PHP_GINIT_FUNCTION ZEND_GINIT_FUNCTION | ||
| #define PHP_GSHUTDOWN_FUNCTION ZEND_GSHUTDOWN_FUNCTION | ||
| #define PHP_CINIT_FUNCTION(module) static void php_##module##_child_init(void) | ||
| #define PHP_CINIT(module) php_##module##_child_init |
There was a problem hiding this comment.
This one should be in the group above. Also please define these macros in the same way as the existing ones, for consistency.
3b86d34 to
3df5b71
Compare
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.