Repository navigation
Conversation
`StreamBase::WriteBuffer()` and `StreamBase::Writev()` pass raw pointers into Buffer memory to the stream. Nothing kept that memory alive while the write was pending, so detaching the ArrayBuffer (e.g. with `transfer()` or `postMessage()`) freed it, and the stream sent whatever reused the memory to the peer. Keep the backing store of each Buffer chunk in the `WriteWrap` until the write completes. Assisted-by: Claude Code Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
Member
Author
|
CC @nodejs/streams @nodejs/net |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67907 +/- ##
==========================================
+ Coverage 90.53% 90.57% +0.03%
==========================================
Files 805 802 -3
Lines 285842 286690 +848
Branches 55187 55376 +189
==========================================
+ Hits 258793 259668 +875
+ Misses 17167 17130 -37
- Partials 9882 9892 +10
🚀 New features to boost your workflow:
|
jasnell
approved these changes
Nov 30, 2026
Collaborator
Member
Author
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.
Stream writes pass raw pointers into Buffer memory to the stream. Nothing kept that memory alive while the write was pending. Detaching the ArrayBuffer freed it, and the peer received whatever reused the memory.
This keeps the backing store of each Buffer chunk in the
WriteWrapuntil the write completes.On v26.13.1 this throws. With this change the client receives only
a.