cargo-fuzz icon indicating copy to clipboard operation
cargo-fuzz copied to clipboard

Suggest using --dev for a repro run with a given artifact

Open hsivonen opened this issue 4 years ago • 4 comments

cargo fuzz run now defaults to release mode since #231. When it finds a failure and prints a command for how to run just that input, it doesn't suggest the --dev flag.

It would be good to suggest the --dev flag for repro, since the purpose of the repro run is presumably to be able to debug the failure, and the default mode seems to even lack sufficient debug info for source attachment.

hsivonen avatar Apr 07 '22 06:04 hsivonen

I think that it should suggest exactly the command and flags that are known to reproduce the failure. It isn't unheard of for some crates to have cfgs that completely change code paths based on whether rustc has optimizations enabled or not, and suggesting --dev could make us miss bug-triggering code paths.

fitzgen avatar Apr 11 '22 17:04 fitzgen

That's a good point. However, it's practically bad that the suggestion compiles without debug info, so the repro isn't useful at all for debugging the problem.

hsivonen avatar Apr 11 '22 17:04 hsivonen

Yes, it's a trade off with no perfect solution and my inclination is to lean towards the "steps to reproduce will always reproduce" side.

fitzgen avatar Apr 11 '22 17:04 fitzgen

We could add debug level 2 to the defaults so that full debug info is available by default. Then there's no need to drop down to --dev.

Shnatsel avatar Apr 04 '23 00:04 Shnatsel