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

cargo fuzz tmin fails when given filenames with special characters

Open krobelus opened this issue 6 years ago • 0 comments

This surfaces when calling cargo fuzz tmin <target> <crash> where <crash> is a filename with special shell characters (honggfuzz produces those by default). I don't know how the shell is called -- it seems that exec_tmin is using exec.

# ~/g/c/testcrate on master ⨯ ../target/debug/cargo-fuzz tmin fuzz_target_1 fuzz/artifacts/fuzz_target_1/crash-\(\)
       Fresh cc v1.0.30
       Fresh arbitrary v0.1.1
       Fresh testcrate v0.1.0 (/home/johannes/git/cargo-fuzz/testcrate)
       Fresh libfuzzer-sys v0.1.0 (https://github.com/rust-fuzz/libfuzzer-sys.git#4a413199)
       Fresh testcrate-fuzz v0.0.1 (/home/johannes/git/cargo-fuzz/testcrate/fuzz)
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `fuzz/target/x86_64-unknown-linux-gnu/debug/fuzz_target_1 -artifact_prefix=/home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/ -minimize_crash=1 -runs=255 'fuzz/artifacts/fuzz_target_1/crash-()'`
INFO: Seed: 1638552190
INFO: Loaded 1 modules   (1445 guards): 1445 [0x560e72897b50, 0x560e728991e4),
CRASH_MIN: minimizing crash input: 'fuzz/artifacts/fuzz_target_1/crash-()' (7 bytes)
CRASH_MIN: executing: fuzz/target/x86_64-unknown-linux-gnu/debug/fuzz_target_1 -artifact_prefix=/home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/ -runs=255 fuzz/artifacts/fuzz_target_1/crash-() >/tmp/libFuzzerTemp.28621.txt 2>&1
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `fuzz/target/x86_64-unknown-linux-gnu/debug/fuzz_target_1 -artifact_prefix=/home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/ -runs=255 fuzz/artifacts/fuzz_target_1/crash-() >/tmp/libFuzzerTemp.28621.txt 2>&1'
CRASH_MIN: 'fuzz/artifacts/fuzz_target_1/crash-()' (7 bytes) caused a crash. Will try to minimize it further
CRASH_MIN: executing: fuzz/target/x86_64-unknown-linux-gnu/debug/fuzz_target_1 -artifact_prefix=/home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/ -runs=255 fuzz/artifacts/fuzz_target_1/crash-() -minimize_crash_internal_step=1 -exact_artifact_path=/home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/minimized-from-a18f4b6a8d7b1f437c41fa9f2b3d8fd9b458c8f7 >/tmp/libFuzzerTemp.28621.txt 2>&1
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `fuzz/target/x86_64-unknown-linux-gnu/debug/fuzz_target_1 -artifact_prefix=/home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/ -runs=255 fuzz/artifacts/fuzz_target_1/crash-() -minimize_crash_internal_step=1 -exact_artifact_path=/home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/minimized-from-a18f4b6a8d7b1f437c41fa9f2b3d8fd9b458c8f7 >/tmp/libFuzzerTemp.28621.txt 2>&1'
*********************************
No such directory: /home/johannes/git/cargo-fuzz/testcrate/fuzz/artifacts/fuzz_target_1/minimized-from-a18f4b6a8d7b1f437c41fa9f2b3d8fd9b458c8f7; exiting

krobelus avatar Mar 11 '19 14:03 krobelus