afl.rs icon indicating copy to clipboard operation
afl.rs copied to clipboard

macOS: shmget() failed

Open walles opened this issue 4 years ago • 3 comments

Help?

I'm on macOS 11.6 Big Sur, x64.

~/s/r/fuzz (master|✚2…) $ cargo afl --version
cargo-afl 0.11.0
~/s/r/fuzz (master|✚2…) $ cargo --version
cargo 1.56.0 (4ed5d137b 2021-10-04)
~/s/r/fuzz (master|✚2…) $ rustc --version
rustc 1.56.0 (09c42c458 2021-10-18)
~/s/r/fuzz (master|✚2…) $ cargo afl fuzz -i /tmp/in -o /tmp/hej target/debug/fuzz_target_1
afl-fuzz++3.14c based on afl by Michal Zalewski and a large online community
[+] afl++ is maintained by Marc "van Hauser" Heuse, Heiko "hexcoder" Eißfeldt, Andrea Fioraldi and Dominik Maier
[+] afl++ is open source, get it at https://github.com/AFLplusplus/AFLplusplus
[+] NOTE: This is v3.x which changes defaults and behaviours - see README.md
[+] No -M/-S set, autoconfiguring for "-S default"
[*] Getting to work...
[+] Using exponential power schedule (FAST)
[+] Enabled testcache with 50 MB
[*] Checking CPU scaling governor...
[+] You have 8 CPU cores and 2 runnable tasks (utilization: 25%).
[+] Try parallel jobs - see docs/parallel_fuzzing.md.
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning '/tmp/in'...
[+] Loaded a total of 1 seeds.
[*] Creating hard links for all input files...
[*] Validating target binary...
[+] Persistent mode binary detected.
[+] Deferred forkserver binary detected.

[-]  SYSTEM ERROR : shmget() failed
    Stop location : afl_shm_init(), src/afl-sharedmem.c:247
       OS message : Invalid argument
~/s/r/fuzz (master|✚2…) [1] $

walles avatar Oct 30 '21 12:10 walles

I can repro this by simply following the tutorial: https://rust-fuzz.github.io/book/afl/tutorial.html

Not what I did originally in the example above, but the tutorial gets me the same results.

walles avatar Oct 30 '21 13:10 walles

@walles Please try this. Run:

find $HOME/.local -name afl-system-config

Find the entry that corresponds to your Rust toolchain and afl.rs version, and run:

sudo path/to/afl-system-config

You will be prompted to enter your password.

Finally, try your original command again.

Please tell me if this does not work.

We're going to have to find a better solution for this.

smoelius avatar Oct 30 '21 13:10 smoelius

Yup, that made AFL start running.

walles avatar Oct 30 '21 13:10 walles