Skip to content

Commit

Permalink
Add timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Apr 4, 2024
1 parent 03f82c6 commit a6099fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ext/fuzztest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
git clone https://github.com/google/fuzztest.git
cd fuzztest
: # There is no tagged release as of 2024/04/01. Pick the latest commit that works.
git checkout dfd4a6441377391a53dd942efa1e228d90d2627c
git checkout 0c80b315a00a944b6c2a0284f84f956e577697b8
: # dfd4a6441377391a53dd942efa1e228d90d2627c
sed -i 's/-fsanitize=address//g' ./cmake/FuzzTestFlagSetup.cmake
sed -i 's/-DADDRESS_SANITIZER//g' ./cmake/FuzzTestFlagSetup.cmake

Expand Down
8 changes: 5 additions & 3 deletions tests/oss-fuzz/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ this_dir=\$(dirname \"\$0\")
export TEST_DATA_DIRS=\$this_dir/corpus
chmod +x \$this_dir/$fuzz_basename
ARGS=\$*
ARGS=\$(echo \${ARGS} | sed \"s/-timeout=\\([0-9]\\+\\)/-fuzz_for=\1s/g\")
# Keep rss_limit_mb
FUZZTEST_FUZZ_FOR_ARGS=\$(echo \${ARGS} | sed \"s/.*-timeout=\\([0-9]\\+\\).*/--fuzz_for=\1s/g\")
#ARGS=\$(echo \${ARGS} | sed \"s/-timeout=\\([0-9]\\+\\)/ /g\")
FUZZTEST_RSS_ARGS=\$(echo \${ARGS} | sed \"s/.*-rss_limit_mb=\\([0-9]\\+\\).*/--rss_limit_mb=\1/g\")
ARGS=\$(echo \${ARGS} | sed \"s/-rss_limit_mb=\\([0-9]\\+\\)/ /g\")
ARGS=\$(echo \${ARGS} | sed \"s/-runs=\\([0-9]\\+\\)/ /g\")
FUZZTEST_PRNG_SEED=\$(echo \${ARGS} | sed \"s/.*-seed=\\([0-9]\\+\\).*/\1/g\")
ARGS=\$(echo \${ARGS} | sed \"s/-seed=\\([0-9]\\+\\)/ /g\")
\$this_dir/$fuzz_basename --fuzz=$fuzz_entrypoint -- \$ARGS
\$this_dir/$fuzz_basename --fuzz=$fuzz_entrypoint \$FUZZTEST_FUZZ_FOR_ARGS \$FUZZTEST_RSS_ARGS -- \$ARGS
echo \"\$this_dir/$fuzz_basename --fuzz=$fuzz_entrypoint -- \$ARGS\"
chmod -x \$this_dir/$fuzz_basename" > $OUT/$TARGET_FUZZER
chmod +x $OUT/$TARGET_FUZZER
Expand Down

0 comments on commit a6099fa

Please sign in to comment.