Skip to content

Conversation

@barrowsr
Copy link

  • 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.

Fixes #333

- 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.
@flowzone-app
Copy link
Contributor

flowzone-app bot commented Jul 10, 2025

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 /deploy

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffer Pool Race Condition Causing Data Corruption in Large Compressed Images

2 participants