Skip to content

fix overflow on total_{in, out} on windows#473

Merged
folkertdev merged 1 commit intomainfrom
windows-overflow
Feb 16, 2026
Merged

fix overflow on total_{in, out} on windows#473
folkertdev merged 1 commit intomainfrom
windows-overflow

Conversation

@folkertdev
Copy link
Copy Markdown
Member

fixes #472

On windows the internal counter for total_{in, out} is a 32-bit integer, which can overflow on modern systems. In our stable API we can do the bookkeeping ourselves and always use 64-bit integers.

I plan to test this in flate2, which we also run in our test suite.

@folkertdev folkertdev requested a review from bjorn3 February 15, 2026 10:59
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
zlib-rs/src/stable.rs 84.61% 4 Missing ⚠️
Flag Coverage Δ
fuzz-compress 39.84% <0.00%> (-0.34%) ⬇️
fuzz-decompress 27.42% <0.00%> (-0.23%) ⬇️
test-aarch64-apple-darwin 86.08% <84.61%> (-1.20%) ⬇️
test-aarch64-unknown-linux-gnu 85.55% <80.76%> (-0.03%) ⬇️
test-i686-unknown-linux-gnu 85.20% <80.76%> (-0.04%) ⬇️
test-x86_64-apple-darwin 85.59% <84.61%> (-1.45%) ⬇️
test-x86_64-unknown-linux-gnu 90.53% <80.76%> (-2.54%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
zlib-rs/src/stable.rs 58.27% <84.61%> (+3.27%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@folkertdev folkertdev merged commit 74c5dd3 into main Feb 16, 2026
29 checks passed
@folkertdev folkertdev deleted the windows-overflow branch February 16, 2026 13:42
EliteTK added a commit to astral-sh/uv that referenced this pull request Mar 7, 2026
Extracting a wheel on windows which has a larger total uncompressed size
than 4GiB leads to panics as seen in
#18316 (comment)

This is caused by
trifectatechfoundation/zlib-rs#472.

zlib 0.6.2 includes
trifectatechfoundation/zlib-rs#473 which
addresses this issue.
EliteTK added a commit to astral-sh/uv that referenced this pull request Mar 7, 2026
…n Windows (#18362)

## Summary

Extracting a wheel on windows which has a larger total uncompressed size
than 4GiB leads to panics as seen in
<#18316 (comment)>.

This is caused by
<trifectatechfoundation/zlib-rs#472>.

`zlib-rs` 0.6.2 includes
<trifectatechfoundation/zlib-rs#473> which
addresses this issue.

## Test Plan

Manually verified via:

```
uv pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-7.2/rocm_sdk_devel-7.2.0.dev0-py3-none-win_amd64.whl
```

On a Windows 11 VM.
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.

Inflater::total_out() overflows 32-bit integer boundary on Windows despite being u64

2 participants