Skip to content

Commit 9cb0174

Browse files
authored
Increase fuzzing memory limit required by address sanitization, and enable sanitizer for build-fuzzer recipe (#342)
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent b997e8d commit 9cb0174

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Justfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,24 @@ bench-ci baseline target=default-target features="":
189189
bench target=default-target features="":
190190
cargo bench --profile={{ if target == "debug" { "dev" } else { target } }} {{ if features =="" {''} else { "--features " + features } }} -- --verbose
191191

192+
#####################################
192193
# FUZZING
194+
#####################################
195+
196+
# Enough memory (4GB) for the fuzzer to run for 5 hours, with address sanitizer turned on
197+
fuzz_memory_limit := "4096"
193198

194199
# Fuzzes the given target
195200
fuzz fuzz-target:
196-
cargo +nightly fuzz run {{ fuzz-target }} --release
201+
cargo +nightly fuzz run {{ fuzz-target }} --release -- -rss_limit_mb={{ fuzz_memory_limit }}
197202

198203
# Fuzzes the given target. Stops after `max_time` seconds
199204
fuzz-timed fuzz-target max_time:
200-
cargo +nightly fuzz run {{ fuzz-target }} --release -- -max_total_time={{ max_time }}
205+
cargo +nightly fuzz run {{ fuzz-target }} --release -- -rss_limit_mb={{ fuzz_memory_limit }} -max_total_time={{ max_time }}
201206

202207
# Builds fuzzers for submission to external fuzzing services
203208
build-fuzzers: (build-fuzzer "fuzz_guest_call") (build-fuzzer "fuzz_host_call") (build-fuzzer "fuzz_host_print")
204209

205210
# Builds the given fuzzer
206211
build-fuzzer fuzz-target:
207-
cargo +nightly fuzz build {{ fuzz-target }} --release -s none
212+
cargo +nightly fuzz build {{ fuzz-target }} --release

0 commit comments

Comments
 (0)