[php-src] PR #25361: Fix GH-25360: ZipArchive assertion when error handler throws at shutdown
| From: | lazerg | Date: | Tue, 10 Nov 2026 08:11:33 +0000 |
| Subject: | [php-src] PR #25361: Fix GH-25360: ZipArchive assertion when error handler throws at shutdown | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40494@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25361
Author: lazerg
When
zip_close() fails in the object destructor at shutdown, the "Cannot destroy
the zip context" warning goes to the user error handler. If that handler throws, there is no
frame to catch the exception, so it bails out in the middle of
php_zip_archive_release(). The refcount is already 0 but the archive is never freed and
intern->archive is never cleared, so free_storage closes it again and
hits the assertion. The warning now runs inside zend_try and sets
bailout_callback like the progress/cancel callbacks do, so cleanup finishes and the
destructor bails out afterwards.
Fixes GH-25360