crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://www.trailofbits.com/
GNU Affero General Public License v3.0
273 stars 33 forks source link

Output non-fuzzing failure related error messages #312

Closed Xenomega closed 3 months ago

Xenomega commented 4 months ago

If you input a bad command/argument, the error is not displayed. This is because main.go never does print it. This fixes that issue.

This prints the error if any had occurred. Question for you @anishnaik , do you think this should instead use the global logger? We could do that now or in the future (if it's not a big concern).

anishnaik commented 3 months ago
Screenshot 2024-03-27 at 1 56 14 PM

The problem in the above is that a fuzzer error (not a test failure) gets logged and also gets printed out here

anishnaik commented 3 months ago

Proposed changed here in the latest commit introduces a new error code which is ErrorCodeFuzzerError. If this error is encountered, then nothing extra is printed in main.go. It's a little bit hacky so feedback would be appreciated.

Screenshot 2024-03-27 at 2 27 41 PM

The image below differentiates between a "fuzzer error" (first run of ./medusa fuzz in the screenshot) and a "general error" (second run of ./medusa fuzz in the screenshot).