aboutsummaryrefslogtreecommitdiff
path: root/projects/cpython3
diff options
context:
space:
mode:
authorAmmar Askar <aaskar@google.com>2019-06-11 16:40:08 -0700
committerjonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2019-06-11 16:40:08 -0700
commit9a67b6be92066449dfe223324c700539c9cc5c02 (patch)
tree22bfe6ea60b089db094732498ef000c797e9b660 /projects/cpython3
parent20830e74fe71072925647ee07fa3f53c9dcfe2e9 (diff)
downloadoss-fuzz-9a67b6be92066449dfe223324c700539c9cc5c02.tar.gz
[cpython] Pull in corpuses and dictionaries for CPython (#2504)
* Pull in corpuses and dictionaries for CPython * Ignore MSAN errors in build
Diffstat (limited to 'projects/cpython3')
-rw-r--r--projects/cpython3/build.sh10
-rw-r--r--projects/cpython3/project.yaml4
2 files changed, 14 insertions, 0 deletions
diff --git a/projects/cpython3/build.sh b/projects/cpython3/build.sh
index f988d3780..6fc996a04 100644
--- a/projects/cpython3/build.sh
+++ b/projects/cpython3/build.sh
@@ -2,6 +2,7 @@
# Ignore memory leaks from python scripts invoked in the build
export ASAN_OPTIONS="detect_leaks=0"
+export MSAN_OPTIONS="halt_on_error=0:exitcode=0"
# Remove -pthread from CFLAGS, this trips up ./configure
# which thinks pthreads are available without any CLI flags
@@ -33,6 +34,15 @@ do
# Link with C++ compiler to appease libfuzzer
$CXX $CXXFLAGS $WORK/$fuzz_test.o -o $OUT/$fuzz_test \
$LIB_FUZZING_ENGINE $($OUT/bin/python3-config --ldflags --embed)
+
+ # Zip up and copy any seed corpus
+ if [ -d "${FUZZ_DIR}/${fuzz_test}_corpus" ]; then
+ zip -j "${OUT}/${fuzz_test}_seed_corpus.zip" ${FUZZ_DIR}/${fuzz_test}_corpus/*
+ fi
+ # Copy over the dictionary for this test
+ if [ -e "${FUZZ_DIR}/dictionaries/${fuzz_test}.dict" ]; then
+ cp "${FUZZ_DIR}/dictionaries/${fuzz_test}.dict" "$OUT/${fuzz_test}.dict"
+ fi
done
# A little bit hacky but we have to copy $OUT/include to
diff --git a/projects/cpython3/project.yaml b/projects/cpython3/project.yaml
index 522054f5e..2e3677dd4 100644
--- a/projects/cpython3/project.yaml
+++ b/projects/cpython3/project.yaml
@@ -2,4 +2,8 @@ homepage: "https://python.org/"
primary_contact: "gps@google.com"
auto_ccs:
- "alex.gaynor@gmail.com"
+sanitizers:
+ - address
+ - memory
+ - undefined
experimental: True