Repository navigation
zlib: handle close before initialization - #67507
Open
ADITHYAKUMARREDDY wants to merge 1 commit into
Open
ADITHYAKUMARREDDY wants to merge 1 commit into
ADITHYAKUMARREDDY wants to merge 1 commit into
Conversation
Fixes nodejs#67485 Signed-off-by: Adithya kumar Reddy Gopavaram <91198686+ADITHYAKUMARREDDY@users.noreply.github.com>
Contributor
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
ADITHYAKUMARREDDY
marked this pull request as ready for review
November 16, 2026 03:57
|
Thanks for picking this up! I tested it and this fixes the bug in the original repro |
jasnell
approved these changes
Nov 18, 2026
Collaborator
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67507 +/- ##
==========================================
+ Coverage 90.67% 90.68% +0.01%
==========================================
Files 799 799
Lines 280245 280246 +1
Branches 54125 54115 -10
==========================================
+ Hits 254100 254130 +30
+ Misses 16280 16237 -43
- Partials 9865 9879 +14
🚀 New features to boost your workflow:
|
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.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
zlib, worker_threads
Description of change
When a worker thread is terminated via
worker.terminate()during compression stream construction, execution halts after the nativeZlibStreaminstance has been allocated (new binding.Zlib(mode)) but beforehandle.init(...)has been executed. As a result, the C++ object hasinit_done_ == false.During isolate teardown (
node::FreeEnvironment), the garbage collector / weak callback invokes the destructor~CompressionStream(), which callsClose(). Previously,Close()asserted:Because
CHECK()callsabort(), the entire Node.js runtime process crashed with an uncatchable native abort.The underlying context classes (
ZlibContext,BrotliContext,ZstdContext) already safely handle uninitialized destruction. This PR:CompressionStream::Close()when!init_done_, allowing uninitialized handles to close cleanly.test/parallel/test-zlib-worker-terminate-stream-construct.jsasserting that the process does not abort.Fixes: #67485