Fix GH-23276: Collect ZipArchive subclasses holding their own streams - #23282
Draft
LamentXU123 wants to merge 3 commits into
Draft
Fix GH-23276: Collect ZipArchive subclasses holding their own streams#23282LamentXU123 wants to merge 3 commits into
LamentXU123 wants to merge 3 commits into
Conversation
Member
It is probably best for a stable branch IMO, that being said I ll review it sometime this weekend. |
Member
|
I would suggest one thing after a quick look. Keep at it, this refcounting approach is likely to cause indirect issues. |
Member
|
I think this is wrong, I believe you need a get_gc object handler for ZipArchive. |
LamentXU123
marked this pull request as draft
August 14, 2026 18:36
Member
Author
|
Apparently I have to take some time to study Zend GC. It seems like we don't have a reasonable way to bypass this entirely. |
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.
I actually doubt this is a bug in the Zend engine. But since I am not familiar with how Zend GC works, I'd fix this is in a completely ext/zip way, to replace the stream's reference to the
ZipArchiveobject with a refcounted archive state, so a stream can keep the underlyingzip_twithout preventing its owningZipArchiveobject from being GC-ed.There can be better fixes, as I said, to fix in the Zend engine. But I think this is a very rare case happening in the zip extension, so I'd rather re-implement it than touching the Zend core, so we don't bother other code.
Fixes GH-23276