Skip to content
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

testing: "unknown encoding version" error / provide documentation on the fuzz input file format #49299

kevinburke opened this issue Nov 2, 2021 · 2 comments


Copy link

@kevinburke kevinburke commented Nov 2, 2021

I'm trying to seed inputs to the fuzzer by adding files to testdata/fuzz, per the documentation.

Here is my test file (for package

package ssh_config

import (

func FuzzDecode(f *testing.F) {
	f.Fuzz(func(t *testing.T, in []byte) {
		_, err := Decode(bytes.NewReader(in))
		if err != nil {
			t.Fatalf("decode %q: %v", string(in), err)

Per the documentation, I tried copying existing files in testdata/config1 and testdata/config2 to testdata/fuzz/Decode. This failed because I should have put them in testdata/fuzz/FuzzDecode but that (repetition of the word "fuzz") wasn't obvious to me from the docs.

I then tried running the fuzzer on Go tip (629ffeb) and got:

--- FAIL: FuzzDecode (0.00s)
    fuzz_test.go:9: "testdata/fuzz/FuzzDecode/config1": unmarshal: unknown encoding version: Host localhost # A comment at the end of a host line.
        "testdata/fuzz/FuzzDecode/config2": unmarshal: unknown encoding version: #	$OpenBSD: ssh_config,v 1.30 2016/02/20 23:06:23 sobrado Exp $

I'm not sure how to resolve that. The docs that I saw (the blog post and in src/testing/testing.go) didn't mention anything about a version format for seed files, and the error message does not explain how to resolve the issue.

I also tried searching Google for information if other people had run into the error, and didn't find any.

Updates #49229.

@kevinburke kevinburke changed the title testing: provide documentation on the fuzz input file format testing: "unknown encoding version" error / provide documentation on the fuzz input file format Nov 2, 2021
Copy link

@thanm thanm commented Nov 2, 2021


Copy link

@katiehockman katiehockman commented Nov 2, 2021

Thanks @kevinburke for reporting this. The corpus files do have a specific version format, and binary files can be converted using

We still need to document this, so I can leave this open for documentation purposes.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants