-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Fuzz parsers #945
Fuzz parsers #945
Conversation
|
In-progess pull, related to #667. |
|
Looks great in general, thanks! Though I want @fabxc to take a final look. Will just make a couple of minor style comments now... |
| @@ -0,0 +1,67 @@ | |||
| package promql | |||
| // +build gofuzz | |||
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.
Couple of style nits:
- For consistency with other Prometheus components, let's do this order:
- license header comment (see e.g. https://github.com/prometheus/prometheus/blob/master/cmd/prometheus/main.go#L1-L12)
- build tag comment
- package definition
- We don't use
/* ... */-style comments, so please switch to//ones.
|
In general what @juliusv said. Don't mind about not having the Makefile stuff setup. I'm weirded out by the constant aliasing of trivial commands anyway – you cannot use them anyway once you want to add an extra flag or such. |
| func FuzzParseExpr(in []byte) int { | ||
| _, err := ParseExpr(string(in)) | ||
|
|
||
| if err == nil { |
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.
Nit: let's remove the blanks above the ifs for consistency with our other code.
|
Looks good so far. #949 turns runtime panics into an |
|
Please ping if you made changes so I know to take another look :) What we still need is something like |
|
Wouldn't it be better to use the variable |
|
Yes :) forgot that I turned it into a variable recently. On Thu, Aug 6, 2015 at 12:26 PM Julius Volz notifications@github.com
|
|
@msiebuhr ping. You are probably busy but it would be really cool to have all your efforts merged :) |
|
Someone should take over this PR as it is really useful. |
|
I had totally forgotten about this! Currently, I don't really have enough spare bandwidth to take care of this. I might get around to look at it in a few weeks time, but I can't make any promises. |
|
I've done a quick update on the branch, but it invariably gives me an import error when I try to build it: |
|
I'm suspecting this is a consequence of dvyukov/go-fuzz#127, but I can't tell for certain. |
|
Turned out it was a vendoring-related bug in the fuzzer. Things should now work... (And Dmitry kindly gave some tips on how to improve things somewhat, which I'm incorporating too.) |
|
Cool, thanks a lot for picking this back up. |
|
I can't readily come up the anything to change... |
|
Okay, thanks. Wasn't sure because of your last comment. |
Still missing
ParseMetricSelectorandParseStmts. Should be done by writing test-cases to the appropriate files.