mirror of https://github.com/google/oss-fuzz.git
51e01dcebc
Giving https://github.com/google/oss-fuzz/pull/12592#issuecomment-2415803665 a go using `bashlex` Will place a script in `/out/replay-build-script.sh` with the script that can be used for replaying. This is still poc and will need some adjustments, e.g. we need some more handling on the bash script's ast to reason about loops. --------- Signed-off-by: David Korczynski <david@adalogics.com> Co-authored-by: Oliver Chang <ochang@google.com> |
||
---|---|---|
.. | ||
Dockerfile | ||
README.md | ||
build_all.sh | ||
build_on_cloudbuild.sh | ||
chronos.sh | ||
cloudbuild.yaml | ||
cloudbuild_all.yaml | ||
e2e-replay-build.sh | ||
match_artifacts.sh | ||
prepare-ccache | ||
prepare-replay-rebuild |
README.md
Usage
Under OSS-Fuzz
root directory:
export PROJECT=libiec61850
export FUZZ_TARGET=fuzz_mms_decode.c
export FUZZING_LANGUAGE=c
infra/experimental/chronos/prepare-recompile "$PROJECT" "$FUZZ_TARGET" "$FUZZING_LANGUAGE"
python infra/helper.py build_image "$PROJECT"
# AddressSanitizer.
docker run -ti --entrypoint="/bin/sh" --env SANITIZER="address" --name "${PROJECT}-origin-asan" "gcr.io/oss-fuzz/${PROJECT}" -c "compile && rm -rf /out/*"
docker commit --change 'CMD ["compile"] --change 'ENTRYPOINT /bin/sh' "${PROJECT}-origin-asan" "gcr.io/oss-fuzz/${PROJECT}-ofg-cached-asan"
docker run -ti --entrypoint="recompile" "gcr.io/oss-fuzz/${PROJECT}-ofg-cached-asan"
# Coverage measurement.
docker run -ti --entrypoint="/bin/sh" --env SANITIZER="coverage" --name "${PROJECT}-origin-cov" "gcr.io/oss-fuzz/${PROJECT}" -c "compile && rm -rf /out/*"
docker commit --change 'CMD ["compile"] --change 'ENTRYPOINT /bin/sh' "${PROJECT}-origin-cov" "gcr.io/oss-fuzz/${PROJECT}-ofg-cached-cov"
docker run -ti --entrypoint="recompile" "gcr.io/oss-fuzz/${PROJECT}-ofg-cached-cov"
Assumptions
- Fuzzer: Chronos assumes
libFuzzer
. Other fuzzers are not well-supported, but may work by setting ENVFUZZING_ENGINE
in project'sDockerfile
. - Sanitizer: Chronos assumes
AddressSanitizer
. Other sanitizers may work by adding setting ENVSANITIZER
in project'sDockerfile
.