rust-fuzz / arbitrary

Generating structured data from arbitrary, unstructured input.

Home Page:https://docs.rs/arbitrary/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Revisit making `String`'s `Arbitrary` implementation fallible

fitzgen opened this issue · comments

At least during test case reduction, it would be better to use from_utf8_lossy, because we would rather have some replacement chars in a smaller string than fail to generate a Self.

Possibly we could set an environment variable from cargo fuzz tmin that changes this behavior, if we still want test case generation to be fallible rather than use replacement chars.

cc @Manishearth

Hmm, makes sense

I think it's important for fallibility to be an option since without that the fuzzer is worse at generating useful strings and also slower.

Fixed (albeit with a slightly different approach than what was discussed here) in #53