Skip to content
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

Fixups for VistedPool #5365

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Fixups for VistedPool #5365

merged 1 commit into from
Nov 5, 2024

Conversation

xzfc
Copy link
Contributor

@xzfc xzfc commented Nov 5, 2024

The PR #5336 introduced a in VisitedListHandle bug which is reproducible after two u8 wraparounds.
This PR fixes it by reseting visit_counters every 255 iterations, not every 256.

@xzfc xzfc requested a review from generall November 5, 2024 02:29
@agourlay
Copy link
Member

agourlay commented Nov 5, 2024

What about having a unit test for this case?

edit: Andrey pointed at the test later 👍

@generall
Copy link
Member

generall commented Nov 5, 2024

There were a test in python client, which cough that. It would be better to have unit test of course.

@@ -142,7 +149,7 @@ mod tests {
assert!(visited_list.check_and_update_visited(0));
assert!(visited_list.check(0));

for _ in 0..260 {
for _ in 0..(u8::MAX as usize * 2 + 10) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think this is a test already

@generall generall merged commit 978c4bd into dev Nov 5, 2024
17 checks passed
@generall generall deleted the opt-visited-u8-fixup branch November 5, 2024 09:52
timvisee pushed a commit that referenced this pull request Nov 8, 2024
@timvisee timvisee mentioned this pull request Nov 8, 2024
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.

3 participants