You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate an assertion error in zend_string_destroy #6
I don't know ways to debug this issue, it's too complex right now.
I have a guess, that I'm using immutable strings from PHP. For example, immutable method names in tests and steal pointer to them to use in misc areas of code instead of crafting zend_string entry by hand. Probably, at the end of request GC tries to clean something (hashtable?) and assertion fails.
Verified independently against the current codebase — confirming this stays closed.
Fix confirmed present and effective on both supported branches:
ReferenceCountedTrait::incrementReferenceCount()/decrementReferenceCount() now throw on immutable payloads (interned strings, immutable arrays, shared-memory data) instead of mutating them.
releaseReference() no-ops entirely for immutable/interned payloads, and only invokes the engine's own rc_dtor_func at refcount zero for non-persistent, non-immutable payloads — mirroring zend_string_release_ex's GC_IMMUTABLE guard that the original assertion was tripping.
StringEntry's constructor skips add-ref for interned strings up front (second independent guard layer).
Landed in 8e017a2 (fix(core): guard refcount mutation against immutable payloads and underflow) on branch 8.4, and already cascaded to master (PHP 8.5) via the automated merge-up (PR merge: cascade 8.4 into master (windows x64, resolved) #182, commit 2c70d43) — 8e017a2 is confirmed an ancestor of origin/master.
Verified on both PHP 8.4 and 8.5:
Branch 8.4 (PHP 8.4) and master (PHP 8.5) both carry the fix.
Both branches' tests-internal-debug CI job (a --enable-debug PHP build built specifically to surface Zend assertion failures like this one) is green on their current HEAD — 8.4@8419047 and master@4195cef.
Activity
lisachenko commentedon Oct 1, 2019
I don't know ways to debug this issue, it's too complex right now.
I have a guess, that I'm using immutable strings from PHP. For example, immutable method names in tests and steal pointer to them to use in misc areas of code instead of crafting
zend_stringentry by hand. Probably, at the end of request GC tries to clean something (hashtable?) and assertion fails.lisachenko commentedon Aug 9, 2026
Should be fixed
lisachenko commentedon Aug 9, 2026
Verified independently against the current codebase — confirming this stays closed.
Fix confirmed present and effective on both supported branches:
ReferenceCountedTrait::incrementReferenceCount()/decrementReferenceCount()now throw on immutable payloads (interned strings, immutable arrays, shared-memory data) instead of mutating them.releaseReference()no-ops entirely for immutable/interned payloads, and only invokes the engine's ownrc_dtor_funcat refcount zero for non-persistent, non-immutable payloads — mirroringzend_string_release_ex'sGC_IMMUTABLEguard that the original assertion was tripping.StringEntry's constructor skips add-ref for interned strings up front (second independent guard layer).8e017a2(fix(core): guard refcount mutation against immutable payloads and underflow) on branch8.4, and already cascaded tomaster(PHP 8.5) via the automated merge-up (PR merge: cascade 8.4 into master (windows x64, resolved) #182, commit2c70d43) —8e017a2is confirmed an ancestor oforigin/master.Verified on both PHP 8.4 and 8.5:
8.4(PHP 8.4) andmaster(PHP 8.5) both carry the fix.tests-internal-debugCI job (a--enable-debugPHP build built specifically to surface Zend assertion failures like this one) is green on their current HEAD —8.4@8419047andmaster@4195cef.StringEntryOwnershipTestexercises interned-string release semantics directly.No further code changes needed — closing confirmed as correct.
Generated by Claude Code