Skip to content

Conversation

@nielsdos
Copy link
Member

@nielsdos nielsdos commented Aug 7, 2025

The request shutdown does not necessarily hold the last reference, if there is still a CV that refers to the array.

The request shutdown does not necessarily hold the last reference, if
there is still a CV that refers to the array.
Copy link
Contributor

@youkidearitai youkidearitai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Looks good to me.

if (GC_DELREF(MBSTRG(all_encodings_list)) == 0) {
/* must be *array* destroy to remove from GC root buffer and free the hashtable itself */
zend_array_destroy(MBSTRG(all_encodings_list));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use zend_array_release?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to avoid the immutability check, but sure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact that's what I proposed initially #19397 (comment)

Copy link
Contributor

@youkidearitai youkidearitai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least, My environment is nothing wrong. LGTM.

@nielsdos nielsdos closed this in cc93bbb Aug 8, 2025
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.

mb_list_encodings() can cause crashes on shutdown

3 participants