fix: buffer pool race condition causing data corruption#334
Open
barrowsr wants to merge 1 commit into
Open
Conversation
- Add reference counting to AlignedLockableBuffer to prevent premature reuse - Modify AlignedReadableState to check refCount before buffer reuse - Update BlockReadStream to properly manage buffer lifecycle - Add comprehensive regression tests for race condition detection Fixes race condition where buffers were returned to pool before all Buffer.slice() references were released, causing data corruption in large compressed image flashing operations (>3.4GB). Resolves checksum mismatches in XZ/GZ compressed image verification.
Contributor
|
A repository maintainer needs to approve these workflow run(s). To approve, maintainers can either: • Submit an approval review on this pull request, OR • Submit a review comment starting with Then re-run the failed job(s) via the Checks tab above. Reviews must be on the specific commit SHA of the workflow run to be considered. |
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.
Fixes race condition where buffers were returned to pool before all Buffer.slice() references were released, causing data corruption in large compressed image flashing operations (>3.4GB).
Resolves checksum mismatches in XZ/GZ compressed image verification.
Fixes #333