3 # Licensed to the Apache Software Foundation (ASF) under one
4 # or more contributor license agreements. See the NOTICE file
5 # distributed with this work for additional information
6 # regarding copyright ownership. The ASF licenses this file
7 # to you under the Apache License, Version 2.0 (the
8 # "License"); you may not use this file except in compliance
9 # with the License. You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing,
14 # software distributed under the License is distributed on an
15 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 # KIND, either express or implied. See the License for the
17 # specific language governing permissions and limitations
20 # Generate and pack seed corpus files, for OSS-Fuzz
23 echo "Usage: $0 <build output dir>"
29 CORPUS_DIR
=/tmp
/corpus
30 ARROW_ROOT
=$
(cd $
(dirname $BASH_SOURCE)/..
/..
/..
; pwd)
31 ARROW_CPP
=$ARROW_ROOT/cpp
34 # NOTE: name of seed corpus output file should be "<FUZZ TARGET>-seed_corpus.zip"
35 # where "<FUZZ TARGET>" is the exact name of the fuzz target executable the
36 # seed corpus is generated for.
38 IPC_INTEGRATION_FILES
=$
(find ${ARROW_ROOT}/testing
/data
/arrow-ipc-stream
/integration
-name "*.stream")
41 ${OUT}/arrow-ipc-generate-fuzz-corpus
-stream ${CORPUS_DIR}
42 # Several IPC integration files can have the same name, make sure
43 # they all appear in the corpus by numbering the duplicates.
44 cp --backup=numbered
${IPC_INTEGRATION_FILES} ${CORPUS_DIR}
45 ${ARROW_CPP}/build-support/fuzzing/pack_corpus.py ${CORPUS_DIR} ${OUT}/arrow-ipc-stream-fuzz_seed_corpus.
zip
48 ${OUT}/arrow-ipc-generate-fuzz-corpus
-file ${CORPUS_DIR}
49 ${ARROW_CPP}/build-support/fuzzing/pack_corpus.py ${CORPUS_DIR} ${OUT}/arrow-ipc-file-fuzz_seed_corpus.
zip
52 ${OUT}/arrow-ipc-generate-tensor-fuzz-corpus
-stream ${CORPUS_DIR}
53 ${ARROW_CPP}/build-support/fuzzing/pack_corpus.py ${CORPUS_DIR} ${OUT}/arrow-ipc-tensor-stream-fuzz_seed_corpus.
zip
56 ${OUT}/parquet-arrow-generate-fuzz-corpus
${CORPUS_DIR}
57 # Add Parquet testing examples
58 cp ${ARROW_CPP}/submodules
/parquet-testing
/data
/*.parquet
${CORPUS_DIR}
59 ${ARROW_CPP}/build-support/fuzzing/pack_corpus.py ${CORPUS_DIR} ${OUT}/parquet-arrow-fuzz_seed_corpus.
zip