Skip to content

cmd/go: fuzz crash minimizer should try deleting, rewriting input bytes #48129

@rsc

Description

@rsc

The fuzzer found a crash in a package I'm working on:

go test fuzz v1
string("--\xd6M\x8b<!---->")

I can manually minimize this input further by just doing a trial deletion of each byte, keeping each deletion only if it preserves the crash (not the exact panic message, because slice bounds are changing while remaining invalid, but the fact of a crash). This reduces the input to:

string("M\x8b<!---->")

Then I can change each input byte to an A, one at a time, keeping the crashes. This simplifies to:

string("AA<!---->")

which appears to be the simplest possible (and more readable) form of this crasher.

What I did, the crash minimizer should be able to do. It will result in more ASCII-only crashes. I would suggest for the input byte rewriting to have a priority list ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ trying letters, digit, space, and finally punctuation for each byte, stopping at the first one that preserves the crash. The letters could be thinned out and the punctuation elided if this is too much. Even ABCXYZabcxyz012789 would be fine.

/cc @jayconrod @katiehockman

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.fuzzIssues related to native fuzzing support

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions