some macos fixes

This commit is contained in:
Dominik Maier 2021-05-26 13:58:12 +02:00
parent 5d44846c27
commit 81ccf7f7d8
4 changed files with 24 additions and 6 deletions

3
.gitignore vendored
View File

@ -9,6 +9,9 @@ Cargo.lock
*.bin *.bin
*.dll *.dll
*.exe *.exe
*.dSYM
.cur_input
crashes crashes

View File

@ -18,7 +18,10 @@ pub mod unix_signals;
pub mod pipes; pub mod pipes;
#[cfg(all(unix, feature = "std"))] #[cfg(all(unix, feature = "std"))]
use std::{ffi::CString, fs::File}; use std::ffi::CString;
#[cfg(all(feature = "std", any(target_os = "linux", target_os = "android")))]
use std::fs::File;
#[cfg(all(windows, feature = "std"))] #[cfg(all(windows, feature = "std"))]
pub mod windows_exceptions; pub mod windows_exceptions;

View File

@ -266,7 +266,7 @@ where
I: Input + HasTargetBytes, I: Input + HasTargetBytes,
OT: ObserversTuple, OT: ObserversTuple,
{ {
pub fn new(target: String, arguments: Vec<String>, observers: OT) -> Result<Self, Error> { pub fn new(target: String, arguments: &[String], observers: OT) -> Result<Self, Error> {
let mut args = Vec::<String>::new(); let mut args = Vec::<String>::new();
let mut use_stdin = true; let mut use_stdin = true;
let out_filename = ".cur_input".to_string(); let out_filename = ".cur_input".to_string();
@ -418,10 +418,9 @@ mod tests {
Error, Error,
}; };
#[test] #[test]
fn test_forkserver() { fn test_forkserver() {
const MAP_SIZE: usize = 65536; const MAP_SIZE: usize = 65536;
let bin = "/usr/bin/echo".to_string(); let bin = "echo";
let args = vec![String::from("@@")]; let args = vec![String::from("@@")];
let mut shmem = StdShMemProvider::new() let mut shmem = StdShMemProvider::new()
@ -436,8 +435,11 @@ mod tests {
&mut shmem_map, &mut shmem_map,
)); ));
let executor = let executor = ForkserverExecutor::<NopInput, _>::new(
ForkserverExecutor::<NopInput, _>::new(bin, args, tuple_list!(edges_observer)); bin.to_string(),
&args,
tuple_list!(edges_observer),
);
// Since /usr/bin/echo is not a instrumented binary file, the test will just check if the forkserver has failed at the initial handshake // Since /usr/bin/echo is not a instrumented binary file, the test will just check if the forkserver has failed at the initial handshake
let result = match executor { let result = match executor {
Ok(_) => true, Ok(_) => true,

10
scripts/shmem_limits.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
sudo sysctl -w kern.sysv.shmmax=524288000
sudo sysctl -w kern.sysv.shmmin=1
sudo sysctl -w kern.sysv.shmmni=64
sudo sysctl -w kern.sysv.shmseg=16
sudo sysctl -w kern.sysv.semmns=130
sudo sysctl -w kern.sysv.shmall=131072000
sudo sysctl -w kern.sysv.maxproc=2048
sudo sysctl -w kern.maxprocperuid=512