[php-src] PR #21635: Fix GH-16811: Crash in zend_test observer on runtime observe_function_names change
| From: | iliaal | Date: | Sat, 04 Apr 2026 12:38:30 +0000 |
| Subject: | [php-src] PR #21635: Fix GH-16811: Crash in zend_test observer on runtime observe_function_names change | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35548@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21635
Author: iliaal
zend_test_observer_OnUpdateCommaList crashes when ini_set changes
observe_function_names at runtime. Two paths:
1. Function exists in the function table but was never called. RUN_TIME_CACHE is NULL,
so ZEND_OBSERVER_DATA null-derefs in zend_observer_remove_handler.
2. observe_all=1 already installed the handler at first call.
OnUpdateCommaList adds the same handler again, finds no free slot, hits
ZEND_UNREACHABLE().
Fix: guard remove/add with runtime cache checks, and remove existing handlers before re-adding to
prevent duplicates.
Fixes #16811