-
Notifications
You must be signed in to change notification settings - Fork 281
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
go-fuzz-build fails with Go 1.15 due to uncertain position of comments #294
Comments
update 1:
update 1.1 |
Same issue, this happens with Go 1.15 and throws a warning for the following files:
|
can confirm getting similar issues on 1.15
|
I believe #265 has the same root cause. |
Assigning a position for all inserted statements/functions should be a useful workaround, I will try this on go-fuzz. POC: https://play.golang.org/p/KNEE2J4FrWt. |
@dvyukov Can you pin this issue so people see it first? |
done |
go-fuzz-build
failed due to function with commentsgo-fuzz-build
failed due to uncertain position of comments
Can confirm this as well; it recently popped up with a new |
I'm also running into this |
Same issue here as well with 1.15.2. Runs just fine on 1.14.9. Tested with prometheus -
With 1.15.2 - failed to execute go build: exit status 2 cd /home/rpmbuild/nimbus8/prometheus-build/tmp/go-fuzz-build886823602/goroot/src/vendor/golang.org/x/crypto/poly1305 vendor/golang.org/x/crypto/poly1305 |
My quick fix until the issue is resolved:
|
Any updates about this? Getting a similar error output: failed to execute go build: exit status 2
# reflect
/usr/local/Cellar/go/1.15.2/libexec/src/reflect/value.go:1432: misplaced compiler directive |
No updates. |
go-fuzz-build
failed due to uncertain position of commentsUse syz-old-env because it contains Go 1.14. syz-env contains Go 1.15 and go-fuzz is broken with Go 1.15: dvyukov/go-fuzz#294
Use syz-old-env because it contains Go 1.14. syz-env contains Go 1.15 and go-fuzz is broken with Go 1.15: dvyukov/go-fuzz#294
Could you put " |
Will you try #307 out? Thanks. |
Nope, doesn't work, same error is still there. |
I’m confused, then. After that PR I can’t reproduce. When you say “the same error”, are you talking about crypto/sha256? |
Yes, I'm talking about the crypto/sha256 error. |
@degeri can you also still reproduce using that PR? |
Hi @josharian . First of all thanks for all the work. I am using 307 and still getting
https://github.com/degeri/dcrd-continuous-fuzz#there-is-also-a-dockerless-version if my repo if you want to have a look. |
I tried, and I can't reproduce using your dockerless shell script and Go 1.15.5. Can you re-install go-fuzz-build from that PR branch and try again? I am really at a loss as to what the difference could be. |
Can you add a line after Line 727 in d9fd818
|
Was seeing if I could reproduce the error @degeri was still running into. At first I thought I was but then I noticed the second commit on #307 isn't actually on the branch so I had to work a bit harder to get it (with
I found it a bit tricky to ensure I was using the right version of go-fuzz-build due to modules. Ended up having to add a go.mod to my go-fuzz clone and had a go.mod looking like this in my test project:
|
Thanks, @danp. Based on that, I’ve merged the PR. Hopefully it’ll be easier to test now. |
@joeshaw should I test on master now ? |
Yes please |
works now 🎉 |
dvyukov/go-fuzz#294 has been fixed hence we can update to 1.15.5
Thank you @dvyukov for this project, and thank you everyone involved in this fix! |
I'm still seeing this issue with Go 1.17. I did the following:
If I'm reading this thread correctly, this should no longer be an issue with the newest version of go-fuzz-build. Is there something else I should do to get it to work? |
For anyone finding this, I actually took a look into open-policy-agent/opa#3243 and it seems the following bypasses the error I see:
|
go 1.21.6, had a similar problem with crypto/internal/bigmod, fixed in the same way: go-fuzz-build -preserve crypto/internal/bigmod For anyone facing this: just make sure the module you're preserving (excluding from go-fuzz instrumentation) is not the module you want to fuzz :) |
This fixes yet more manifestations of #294.
And re-instrument reflect. Sheesh. #294. Again.
Sent #353 which will fix more such issues. For others finding this thread with their own new packages that don't build: Please provide a short standalone reproducer, not just a package path (or worse, just an error message with a line number). Thank you. |
This fixes yet more manifestations of #294.
And re-instrument reflect. Sheesh. #294. Again.
failed case 1:
go-fuzz-build will transform the input file to the following, which is obviously incorrect:
I found this probably a go bug and submitted an issue: golang/go#40546
I've also fixed this import issue with an ugly patch: https://github.com/oraluben/go-fuzz/tree/fix-import, but that does not overcome this issue, see case 2:
failed case 2
the source: https://github.com/golang/go/blob/master/src/reflect/value.go#L1421-L1451
the transformed code:
you can find
//go:nocheckptr
was inserted in the middle.I found it not easy to fix this without fixing the printer's logic, maybe you would have more idea about how to workaround this in
go-fuzz-build
?The text was updated successfully, but these errors were encountered: