Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: shmget() failed #195

Open
walles opened this issue Oct 30, 2021 · 3 comments
Open

macOS: shmget() failed #195

walles opened this issue Oct 30, 2021 · 3 comments

Comments

@walles
Copy link

walles commented Oct 30, 2021

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
Copy link
Author

walles commented Oct 30, 2021

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.

@smoelius
Copy link
Member

@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.

@walles
Copy link
Author

walles commented Oct 30, 2021

Yup, that made AFL start running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants