Skip to content

Fix weakref unregister assertion after stack overflow - #23492

Open
2akouwu wants to merge 1 commit into
php:masterfrom
2akouwu:fix/issue-22650
Open

Fix weakref unregister assertion after stack overflow#23492
2akouwu wants to merge 1 commit into
php:masterfrom
2akouwu:fix/issue-22650

Conversation

@2akouwu

@2akouwu 2akouwu commented Aug 29, 2026

Copy link
Copy Markdown

Fixes #22650.

Handle the narrow case where a WeakReference is being unregistered after its referent has already disappeared from EG(weakrefs) during stack-overflow unwinding. Clear the stale IS_OBJ_WEAKLY_REFERENCED flag and return instead of asserting on a registry entry that is no longer present. Normal registered weakref invariants remain unchanged.

Signed-off-by: ulofiai <309826581+ulofiai@users.noreply.github.com>
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.

Assertion failure zend_weakref_unregister(zend_object *, void *, _Bool): Assertion 'tagged_ptr && "Weakref not registered?"' failed

1 participant