Skip to content

ext/opcache: Mark request-time persistent strings as thread-local - #24421

Open
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/opcache-dl-rc-debug-strings
Open

iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/opcache-dl-rc-debug-strings

Conversation

@iliaal

@iliaal iliaal commented Oct 19, 2026

Copy link
Copy Markdown
Member

Fixes the nightly LINUX_X64_VARIATION_DEBUG_ZTS failures of frameless_temporary_opcache.phpt and, on 8.5+, frameless_temporary.phpt. Names that dl() registers during a request come back from opcache's interned-string handlers as plain persistent strings, so the first refcount change on one trips the ZEND_RC_DEBUG assertion. They belong to the request's temporary module, so they are now marked GC_PERSISTENT_LOCAL; release builds are unaffected.

During a request, opcache's interned-string handlers return a plain
persistent string when the name is not already in shared memory. dl()
registers a temporary module's function, class and property names this
way, so under ZEND_RC_DEBUG the first refcount change on one of them
(building an argument TypeError, ReflectionFunction::getName(),
get_object_vars()) trips the persistent-string assertion. The strings
belong to the request's temporary module; mark them GC_PERSISTENT_LOCAL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant