Fix assertion failure when shard_roll_to_valid() iterates to the end#786
Merged
Fix assertion failure when shard_roll_to_valid() iterates to the end#786
Conversation
Prevents shard->current from wrapping around from 0 (ZMAP_SHARD_DONE) to -1 and causing an assertion failure in the constraint lookup code: Assertion failed: (index < con->root->count), function constraint_lookup_index, file constraint.c, line 253. This situation only manifested if one of the send threads happened to get a range containing no usable elements, which is extremely unlikely in normal ZMap use cases, but occurred frequently when scanning only very few targets using multiple send threads, i.e. #threads ≈ #targets.
zakird
approved these changes
Feb 16, 2024
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.
Prevents shard->current from wrapping around from 0 (
ZMAP_SHARD_DONE) to -1 and causing an assertion failure in the constraint lookup code:This situation only manifested if one of the send threads happened to get a range containing no usable elements, which is extremely unlikely in normal ZMap use cases, but occurred relatively frequently when scanning only very few targets, such as a /29, using multiple send threads, i.e. #threads ≈ #targets.