On Sun, 2022-04-24 at 05:21 -0700, Tiago Katcipis wrote:
> Hi,
>
> I was playing around with Go's fuzz support on a pet project of mine
> and as the fuzzer found some offending inputs it created the corpus
> entries on the file system. I fixed the issues but then something
> interesting happened on my CI pipeline, go test was failing only on
> windows and it was failing with a panic inside the call to f.Fuzz.
>
> The code doing the fuzzing can be found here:
> https://github.com/madlambda/jtoh/blob/b2da122b83d791f0b1c2e81adb05c698d8772220/jtoh_fuzz_test.go#L111
>
> Details on the error can be seen here:
> https://github.com/madlambda/jtoh/runs/5963485864?check_suite_focus=true#step:5:6
>
> The panic message: "unmarshal: unknown encoding version: go test fuzz
> v1".
>
> Following that I created a minimal project reproducing the issue:
>
> https://github.com/katcipis/go-fuzz-win-issue/pull/1
>
> The problem persists, nothing is done on the fuzz function:
>
> https://github.com/katcipis/go-fuzz-win-issue/blob/main/fuzz_test.go
>
> It works both on macos and linux (ubuntu 20.04), but it fails on both
> windows-2019/windows-2022 as can be seen here:
>
>
https://github.com/katcipis/go-fuzz-win-issue/runs/6085678496?check_suite_focus=true
>
> The go version is show on the CI:
>
>
https://github.com/katcipis/go-fuzz-win-issue/runs/6085678496?check_suite_focus=true#step:3:6
>
>
> Am I missing something obvious here or is there something wrong with
> fuzzing on Windows targets ?
>

I suspect that this is from GitHub checking out the code on windows
with autocrlf and so converting perfectly sensible \n to \r\n, which is
then not properly handled by this
https://github.com/golang/go/blob/96c8cc7fea94dca8c9e23d9653157e960f2ff472/src/internal/fuzz/encoding.go#L105
.

It would be worth filing an issue for this.

Dan


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6abba1ffe8319896031af36399bf65286bbe1660.camel%40kortschak.io.

Reply via email to