oss-fuzz/infra/base-images/base-builder
DavidKorczynski d6712d688b
infra: bump introspector (#10888)
This has a set of performance improvements in Fuzz Introspector, the two
changes with most impact are:
- removal of some expensive and unnecessary loops in the code
- switching parsing of large yaml files from pure python code to using a
C backend.

Locally it makes OpenSSL builds take approximately 70 minutes whereas in
the cloud build it seems to take 20+ hours. Similar impact happens
across several large java projects.

Signed-off-by: David Korczynski <david@adalogics.com>
2023-08-29 07:26:35 +10:00
..
jcc Improve jcc (#10783) 2023-08-15 12:23:09 -04:00
sanitizers/pysecsan Log errors when no targets are specified for `download_corpora` (#10014) 2023-04-03 06:01:59 +00:00
test_data Add scripts to bisect clang commits that introduced regressions (#2849) 2019-10-03 15:35:31 -07:00
Dockerfile Improve jcc (#10783) 2023-08-15 12:23:09 -04:00
README.md [infra] Dummy change in the base-builder to test something. 2020-02-06 11:11:24 -08:00
bazel.bazelrc Get rid of :introspector images. Build introspector in main images (#8868) 2022-10-27 08:27:12 -04:00
bazel_build_fuzz_tests Reland "[infra] Update Jazzer to v0.17.1" (#10537)" (#10538) 2023-06-26 18:35:40 -04:00
bisect_clang.py Replace terms that are uninclusive. (#5045) 2021-01-25 08:41:34 -08:00
bisect_clang_test.py [infra][tests][NFC] Change mocked function prefix from "mocked_" to "mock_" (#6198) 2021-08-12 11:25:57 -07:00
cargo rust coverage: broader definition for remaps (#6595) 2021-10-19 15:50:08 -05:00
compile infra: bump introspector (#10888) 2023-08-29 07:26:35 +10:00
compile_afl switch to AFL++'s new pcguard instrumentation (#10427) 2023-06-14 16:02:42 -04:00
compile_centipede Build centipede from fuzztest repo. (#10248) 2023-06-07 02:06:38 +00:00
compile_fuzztests.sh infra: enable fuzztest compile script to build non-fuzztest fuzzers (#9733) 2023-02-20 01:37:52 -08:00
compile_go_fuzzer infra: have timeout per fuzz target for coverage (#7831) 2022-07-07 17:00:39 +02:00
compile_honggfuzz infra: add support for netdriver fuzzing with honggfuzz (#7351) 2022-09-12 11:58:12 +10:00
compile_javascript_fuzzer Do not install Jazzer.js in the compile_javascript_fuzzer script (#10381) 2023-05-30 17:08:41 +10:00
compile_libfuzzer golang: fixes libfuzzer signal handling (#10314) 2023-05-18 11:29:38 +10:00
compile_native_go_fuzzer Refactor infra of Go 1.18 fuzzers (#8937) 2022-11-21 17:55:11 +00:00
compile_python_fuzzer pysecsan: refine and add as option in compile_python_fuzzer (#9169) 2023-03-08 12:10:01 -08:00
debug_afl remove map size for afl++ (#5433) 2021-03-18 14:49:58 +00:00
detect_repo.py [CIFuzz] Fix repo detection for repos downloaded through "go get". (#5481) 2021-03-23 11:01:02 -07:00
detect_repo_test.py [CIFuzz] Fix repo detection for repos downloaded through "go get". (#5481) 2021-03-23 11:01:02 -07:00
install_deps.sh Don't install git via ppa (#8470) 2022-09-13 08:37:38 +01:00
install_go.sh Golang signal handler builds fixes (#10367) 2023-05-24 13:49:10 +10:00
install_java.sh Reland "[infra] Update Jazzer to v0.17.1" (#10537)" (#10538) 2023-06-26 18:35:40 -04:00
install_javascript.sh Integrate Jazzer.js (#9466) 2023-01-31 11:31:54 -05:00
install_python.sh Upgrade Atheris (#8886) 2022-10-31 10:27:27 -07:00
install_rust.sh [language builders] Get rid of base-builder-new (#6361) 2021-09-01 13:36:17 -07:00
install_swift.sh [infra][NFC] Silence some useless logging (#9617) 2023-02-07 04:20:31 +00:00
llvmsymbol.diff Swift ideal integration (#6312) 2021-09-02 14:56:01 -07:00
ossfuzz_coverage_runner.go [infra] Add code coverage report generation for Go projects (#3142) 2020-11-19 00:14:30 -08:00
precompile_afl [AFL++][base-builder] Precompile afl++ (#5290) 2021-03-03 19:10:35 -08:00
precompile_centipede Build centipede from fuzztest repo. (#10248) 2023-06-07 02:06:38 +00:00
precompile_honggfuzz [AFL++][base-builder] Precompile afl++ (#5290) 2021-03-03 19:10:35 -08:00
python_coverage_helper.py infra: enable argument passing to compile_python_fuzzer (#7628) 2022-04-28 09:38:43 +01:00
srcmap [infra] Improve srcmap support for Go projects (#3355, #2714). (#3664) 2020-04-16 22:44:01 -07:00
write_labels.py handle wildcard label applying to all fuzz targets in a project (#7359) 2022-03-04 14:59:08 +11:00

README.md

base-builder

Abstract base image for project builders.

Every project image supports multiple commands that can be invoked through docker after the image is built:

docker run --rm -ti gcr.io/oss-fuzz/$project <command> <arguments...>

Supported Commands

Command Description
compile (default) build all fuzz targets
/bin/bash drop into shell, execute compile script to start build.

Build Configuration

A single build image can build same set of fuzzers in many configurations. The configuration is picked through one or more environment variables.

Env Variable Description
$SANITIZER ("address") Specifies predefined sanitizer configuration to use. address or memory or undefined.
$SANITIZER_FLAGS Specify compiler sanitizer flags directly. Overrides $SANITIZER.
$COVERAGE_FLAGS Specify compiler flags to use for fuzzer feedback coverage.
$BUILD_UID User id to use while building fuzzers.

Examples

  • building sqlite3 fuzzer with UBSan (SANITIZER=undefined):
docker run --rm -ti -e SANITIZER=undefined gcr.io/oss-fuzz/sqlite3

Image Files Layout

Location Env Description
/out/ $OUT Directory to store build artifacts (fuzz targets, dictionaries, options files, seed corpus archives).
/src/ $SRC Directory to checkout source files
/work/ $WORK Directory for storing intermediate files
/usr/lib/libFuzzingEngine.a $LIB_FUZZING_ENGINE Location of prebuilt fuzzing engine library (e.g. libFuzzer) that needs to be linked with all fuzz targets.

While files layout is fixed within a container, the environment variables are provided to be able to write retargetable scripts.

Compiler Flags

You must use special compiler flags to build your project and fuzz targets. These flags are provided in following environment variables:

Env Variable Description
$CC The C compiler binary.
$CXX, $CCC The C++ compiler binary.
$CFLAGS C compiler flags.
$CXXFLAGS C++ compiler flags.

Most well-crafted build scripts will automatically use these variables. If not, pass them manually to the build tool.

Child Image Interface

Sources

Child image has to checkout all sources that it needs to compile fuzz targets into $SRC directory. When the image is executed, a directory could be mounted on top of these with local checkouts using docker run -v $HOME/my_project:/src/my_project ....

Other Required Files

Following files have to be added by child images:

File Location Description
$SRC/build.sh build script to build the project and its fuzz targets