-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allocator_api
tests failing
#230
Comments
This was referenced Feb 13, 2024
Maybe |
overlookmotel
added a commit
to overlookmotel/bumpalo
that referenced
this issue
Feb 14, 2024
Yes, I think |
overlookmotel
added a commit
to overlookmotel/bumpalo
that referenced
this issue
Feb 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The CI failure discovered in #229 is also failing on
main
(reproduced locally on M1 Macbook Pro).cargo test --features allocator_api
on nightly is sufficient to trigger it.The failing test is:
bumpalo/tests/all/allocator_api.rs
Lines 163 to 211 in f8278d6
Have traced it to:
bumpalo/src/lib.rs
Lines 1705 to 1745 in f8278d6
That test seems to produce a lot of calls to
Bump::shrink
whereold_size
andnew_size
are both 1, andptr
andnew_ptr
are equal (so the copy is indeed overlapping).In these cases,
delta == 0
andold_size / 2 == 0
, so(delta >= old_size / 2) == true
.Changing that test to
delta > 0 && delta >= old_size / 2
solves this specific problem (cargo test --all-features
passes), but I'm not sure if it still would allow other illegal cases through.I'm afraid I don't understand the logic well enough to make a PR, but I hope this may be helpful in finding a fix.
The text was updated successfully, but these errors were encountered: