Skip to content

Commit

Permalink
helper.py run should use .options file
Browse files Browse the repository at this point in the history
It is very unfortunate, but we have to copy the file. I'll think
how it is possible to restructure our images to avoid duplication.

Issue #19
  • Loading branch information
mikea committed Nov 2, 2016
1 parent e1a2d3c commit 8e2aa92
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infra/base-images/libfuzzer-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
FROM ossfuzz/base
MAINTAINER [email protected]
RUN apt-get install -y gdb
COPY llvm-symbolizer /usr/local/bin
COPY llvm-symbolizer run_fuzzer /usr/local/bin/
ENV ASAN_OPTIONS="symbolize=1:detect_leaks=0"

# set up /out dir
Expand Down
31 changes: 31 additions & 0 deletions infra/base-images/libfuzzer-runner/run_fuzzer
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -eu
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

# Fuzzer runner.

FUZZER=$1
shift
CMD_LINE="$FUZZER $@"

OPTIONS_FILE="${FUZZER}.options"
if [ -f $OPTIONS_FILE ]; then
OPTIONS_ARGS=$(grep "=" $OPTIONS_FILE | sed 's/\(\w*\)\W*=\W*\(.*\)/-\1=\2 /g' | tr '\n' ' ')
CMD_LINE="$CMD_LINE $OPTIONS_ARGS"
fi

echo $CMD_LINE
bash -c "$CMD_LINE"
1 change: 1 addition & 0 deletions infra/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def run_fuzzer(run_args):
'docker', 'run', '-i',
'-v', '%s:/out' % os.path.join(BUILD_DIR, 'out'),
'-t', 'ossfuzz/libfuzzer-runner',
'run_fuzzer',
'/out/%s/%s' %(args.target_name, args.fuzzer_name)
] + args.fuzzer_args

Expand Down

0 comments on commit 8e2aa92

Please sign in to comment.