Skip to content

Commit 1d4039f

Browse files
authored
Merge branch 'master' into upstream-gitpython
2 parents 297aa3c + 1204148 commit 1d4039f

File tree

9 files changed

+62
-24
lines changed

9 files changed

+62
-24
lines changed

infra/base-images/base-builder/jcc/jcc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ func WriteStdErrOut(outstr string, errstr string) {
357357
// Prints |outstr| to stdout, prints |errstr| to stderr, and saves |errstr| to err.log.
358358
fmt.Print(outstr)
359359
fmt.Fprint(os.Stderr, errstr)
360-
AppendStringToFile("/out/err.log", errstr)
360+
AppendStringToFile("/workspace/err.log", errstr)
361361
}
362362

363363
func main() {

infra/base-images/base-clang/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y wget sudo && \
3636
RUN apt-get update && apt-get install -y git && \
3737
git clone https://github.com/ossf/fuzz-introspector.git fuzz-introspector && \
3838
cd fuzz-introspector && \
39-
git checkout bb419272223f251599a5f9c7581073e23a487369 && \
39+
git checkout cfb5266a4c45cbec8663bb1b215c7fd326c60901 && \
4040
git submodule init && \
4141
git submodule update && \
4242
apt-get autoremove --purge -y git && \

infra/build/functions/target_experiment.py

+25-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
JCC_DIR = '/usr/local/bin'
2929

3030

31-
def run_experiment(project_name, target_name, args, output_path,
31+
def run_experiment(project_name, target_name, args, output_path, errlog_path,
3232
build_output_path, upload_corpus_path, upload_coverage_path,
3333
experiment_name, upload_reproducer_path):
3434
config = build_project.Config(testing=True,
@@ -72,6 +72,7 @@ def run_experiment(project_name, target_name, args, output_path,
7272

7373
build = build_project.Build('libfuzzer', 'address', 'x86_64')
7474
local_output_path = '/workspace/output.log'
75+
local_jcc_err_path = '/workspace/err.log' # From jcc.go:360.
7576
local_corpus_path_base = '/workspace/corpus'
7677
local_corpus_path = os.path.join(local_corpus_path_base, target_name)
7778
default_target_path = os.path.join(build.out, target_name)
@@ -81,6 +82,24 @@ def run_experiment(project_name, target_name, args, output_path,
8182
local_stacktrace_path = os.path.join(build.out, 'stacktrace/')
8283
fuzzer_args = ' '.join(args + [f'-artifact_prefix={local_artifact_path}'])
8384

85+
# Upload JCC's err.log.
86+
if errlog_path:
87+
compile_step_index = -1
88+
for i, step in enumerate(steps):
89+
step_args = step.get('args', [])
90+
if '&& compile' in ' '.join(step_args):
91+
compile_step_index = i
92+
break
93+
if compile_step_index == -1:
94+
print('Cannot find compile step.')
95+
else:
96+
# Insert the upload step right after compile step.
97+
upload_jcc_err_step = {
98+
'name': 'gcr.io/cloud-builders/gsutil',
99+
'args': ['cp', local_jcc_err_path, errlog_path]
100+
}
101+
steps.insert(compile_step_index + 1, upload_jcc_err_step)
102+
84103
env = build_project.get_env(project_yaml['language'], build)
85104
env.append('RUN_FUZZER_MODE=batch')
86105
env.append('CORPUS_DIR=' + local_corpus_path)
@@ -268,6 +287,10 @@ def main():
268287
parser.add_argument('--upload_build_log',
269288
required=True,
270289
help='GCS build log location.')
290+
parser.add_argument('--upload_err_log',
291+
required=False,
292+
default='',
293+
help='GCS JCC error log location.')
271294
parser.add_argument('--upload_output_log',
272295
required=True,
273296
help='GCS log location.')
@@ -287,7 +310,7 @@ def main():
287310
args = parser.parse_args()
288311

289312
run_experiment(args.project, args.target, args.args, args.upload_output_log,
290-
args.upload_build_log, args.upload_corpus,
313+
args.upload_err_log, args.upload_build_log, args.upload_corpus,
291314
args.upload_coverage, args.experiment_name,
292315
args.upload_reproducer)
293316

projects/apache-poi/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ WORKDIR ${SRC}
4242
RUN git clone --depth 1 https://github.com/apache/poi.git
4343

4444
# install packages required for font-handling and other code in java.awt.*
45-
RUN apt-get install -y libxext6 libx11-6 libxrender1 libxtst6 libxi6 libxcb1 libxau6 libxdmcp6
45+
RUN apt-get install -y libxext6 libx11-6 libxrender1 libxtst6 libxi6 libxcb1 libxau6 libxdmcp6 \
46+
&& apt-get clean autoclean \
47+
&& apt-get autoremove --yes \
48+
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
4649

4750
ADD pom.xml build.sh ${SRC}/
4851
ADD src/ ${SRC}/src/

projects/apache-poi/src/main/java/org/apache/poi/POIFuzzer.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,16 @@ public static void checkExtractor(byte[] input) {
124124
public static void checkExtractor(POITextExtractor extractor) throws IOException {
125125
extractor.getDocument();
126126
extractor.getFilesystem();
127-
extractor.getMetadataTextExtractor();
128-
extractor.getText();
127+
try {
128+
extractor.getMetadataTextExtractor();
129+
} catch (IllegalStateException e) {
130+
// can happen here
131+
}
132+
try {
133+
extractor.getText();
134+
} catch (OpenXML4JRuntimeException e) {
135+
// can happen here
136+
}
129137

130138
if (extractor instanceof POIOLE2TextExtractor) {
131139
POIOLE2TextExtractor ole2Extractor = (POIOLE2TextExtractor) extractor;

projects/apache-poi/src/main/java/org/apache/poi/POIVisioFuzzer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void fuzzerTestOneInput(byte[] input) {
3838
visio.write(NullOutputStream.INSTANCE);
3939
} catch (IOException | POIXMLException |
4040
BufferUnderflowException | RecordFormatException | OpenXML4JRuntimeException |
41-
IllegalArgumentException | IndexOutOfBoundsException e) {
41+
IllegalArgumentException | IndexOutOfBoundsException | IllegalStateException e) {
4242
// expected here
4343
}
4444

projects/hsqldb/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
FROM gcr.io/oss-fuzz-base/base-builder-jvm
1818

19-
RUN curl -L https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.12-bin.zip -o ant.zip && \
19+
RUN curl -L https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.14-bin.zip -o ant.zip && \
2020
unzip ant.zip -d $SRC/ant && \
2121
rm -rf ant.zip
2222

23-
ENV ANT $SRC/ant/apache-ant-1.10.12/bin/ant
23+
ENV ANT $SRC/ant/apache-ant-1.10.14/bin/ant
2424

2525
RUN svn checkout https://svn.code.sf.net/p/hsqldb/svn/base/trunk hsqldb-svn
2626

2727
COPY build.sh $SRC/
2828
COPY *.java $SRC/
29-
WORKDIR $SRC/hsqldb
29+
WORKDIR $SRC/hsqldb

projects/libyaml/project.yaml

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
homepage: https://github.com/yaml/libyaml
22
language: c++
3-
primary_contact: "[email protected]"
3+
primary_contact: [email protected]
44
auto_ccs:
5-
6-
7-
5+
86
fuzzing_engines:
9-
- libfuzzer
10-
- afl
11-
- honggfuzz
7+
- libfuzzer
8+
- afl
9+
- honggfuzz
1210
sanitizers:
13-
- address
14-
- memory
15-
- undefined
11+
- address
12+
- memory
13+
- undefined
1614
architectures:
17-
- x86_64
18-
- i386
19-
main_repo: 'https://github.com/yaml/libyaml'
15+
- x86_64
16+
- i386
17+
main_repo: https://github.com/yaml/libyaml

projects/lua/build.sh

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ esac
6565

6666
export LSAN_OPTIONS="verbosity=1:log_threads=1"
6767

68+
# Workaround for a LeakSanitizer crashes,
69+
# see https://github.com/google/oss-fuzz/issues/11798.
70+
if [ "$ARCHITECTURE" = "aarch64" ]; then
71+
export ASAN_OPTIONS=detect_leaks=0
72+
fi
73+
6874
: ${LD:="${CXX}"}
6975
: ${LDFLAGS:="${CXXFLAGS}"} # to make sure we link with sanitizer runtime
7076

0 commit comments

Comments
 (0)