-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[test] fix fuzz tests that might crash on duplicate settings params #10779
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Binary file added
BIN
+2.09 KB
...ader_corpus/clusterfuzz-testcase-minimized-request_header_fuzz_test-4795710559223808.fuzz
Binary file not shown.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems preferable to use a map instead now that uniqueness checks are not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on what the intent of this helper was. If it was to detect erroneous accidental double settings in tests, then the original was best.
It's a bit strange that we do a set of nghttp2_settings_entry instead of a map<settings_id, value> and fail when setting_id is duplicated. I can see us doing the nghttp2_settings_entry if we're trying to avoid errorneously sending the exact same setting_id, value pair multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent was to simply provide a helper to fetch SETTINGS parameters received from a peer. The use of the set was based on my misunderstanding of the RFC; the goal was to be very explicit about the uniqueness requirement through the type used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up on Antonio's point about accidentally sending duplicate pairs, we should add a test that validates that condition does not happen, but this utility should be generic enough to support both the existing unit tests, fuzz tests and to-be-written duplicate parameter tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to an unordered-map. this isn't relevant to
sendSettings
, which fwiw parses configuration settings for your codecs. (And we can impose restrictions like do not duplicate settings in your config). I can write a test that sends a settingsframe containing duplicate settings in a frame (this would have always worked against a real envoy, since this is just test utility)