Set zend_rc_debug=false before loading shared ext in FPM config#18075
Closed
arnaud-lb wants to merge 1 commit intophp:PHP-8.3from
Closed
Set zend_rc_debug=false before loading shared ext in FPM config#18075arnaud-lb wants to merge 1 commit intophp:PHP-8.3from
arnaud-lb wants to merge 1 commit intophp:PHP-8.3from
Conversation
bukka
reviewed
Mar 15, 2025
b270f11 to
f86b29c
Compare
bukka
approved these changes
Mar 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.phptfails 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.