diff options
author | James Zern <jzern@google.com> | 2018-11-21 12:04:23 -0800 |
---|---|---|
committer | Max Moroz <dor3s1@gmail.com> | 2018-11-21 12:04:23 -0800 |
commit | 2e74eaebf509ac777be435467280fe467bcd318d (patch) | |
tree | 852d678ef70a08059bf5cc1c83fc214afd40bbf5 /projects/libvpx | |
parent | 7995868cdcc12fd3bafd8d189c33217c3485968b (diff) | |
download | oss-fuzz-2e74eaebf509ac777be435467280fe467bcd318d.tar.gz |
[libvpx] update memory limit for msan (#1966)
Reduce VPX_MAX_ALLOCABLE_MEMORY in msan builds as it has a higher overhead causing more frequent OOMs in this configuration. This matches the limits in libaom.
Diffstat (limited to 'projects/libvpx')
-rwxr-xr-x | projects/libvpx/build.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/projects/libvpx/build.sh b/projects/libvpx/build.sh index 52534a427..170d5a320 100755 --- a/projects/libvpx/build.sh +++ b/projects/libvpx/build.sh @@ -21,10 +21,19 @@ rm -rf ${build_dir} mkdir -p ${build_dir} pushd ${build_dir} +# oss-fuzz has 2 GB total memory allocation limit. So, we limit per-allocation +# limit in libvpx to 1 GB to avoid OOM errors. A smaller per-allocation is +# needed for MemorySanitizer (see bug oss-fuzz:9497 and bug oss-fuzz:9499). +if [[ $CFLAGS = *sanitize=memory* ]]; then + extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=536870912' +else + extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=1073741824' +fi + LDFLAGS="$CXXFLAGS" LD=$CXX $SRC/libvpx/configure \ --disable-unit-tests \ --size-limit=12288x12288 \ - --extra-cflags="-DVPX_MAX_ALLOCABLE_MEMORY=1073741824" \ + --extra-cflags="${extra_c_flags}" \ --disable-webm-io \ --enable-debug make -j$(nproc) all |