Set zend_rc_debug=false before loading shared ext in FPM config #18075
+14
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the following nightly failure: https://github.com/php/php-src/actions/runs/13868159277/job/38811107321. This is triggered by #17961, but the root issue was pre-existing.
The test
sapi/fpm/tests/gh9921-php-value-ext-mod-handlers.phpt
fails an assertion inZEND_RC_MOD_CHECK()
here:php-src/Zend/zend_types.h
Lines 1322 to 1325 in 45c7e3b
when trying to copy the property name here:
php-src/Zend/zend_API.c
Line 4421 in 1c18267
The property name is a persistent string created here:
php-src/ext/dl_test/dl_test_arginfo.h
Line 69 in 1c18267
Backtrace:
This is reproducible with
CFLAGS=-DZEND_RC_DEBUG=1 --enable-debug --enable-zts
.Root cause is that
php_dl()
breaks invariant by manipulating the refcount of persistent strings after startup, which is normally not allowed. This causesZEND_RC_MOD_CHECK()
to fail.The
dl()
function disables this check:php-src/ext/standard/dl.c
Lines 61 to 67 in 45c7e3b
Here I apply the same workaround before calling
php_dl()
infpm_php_apply_defines_ex
.