Skip to content

Commit

Permalink
bc-gh: Add Dockerfile and build.sh
Browse files Browse the repository at this point in the history
I set `disabled` to true because LeakSanitizer claims the fuzzers have
leaks. However, this is not true because bc and dc run without leaks
under Valgrind.

After some debugging, I can cause them to free the memory by putting an
`assert(false);` after all of the frees [1] [2], and it trips. But if I
remove it, LeakSanitizer sees leaks.

Whether it's PEBKAC (probably) or miscompilation (unlikely), I don't
know, but I figured I'd commit the necessary stuff for the project.

I'll try to figure out the problem later.

[1]: https://github.com/gavinhoward/bc/blob/master/src/bc_fuzzer.c#L110
[2]: https://github.com/gavinhoward/bc/blob/master/src/dc_fuzzer.c#L110

Signed-off-by: Gavin D. Howard <[email protected]>
  • Loading branch information
gavinhoward committed Jun 18, 2024
1 parent deef8c5 commit edfa5f6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/bc-gh/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Google LLC
#
# 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.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y make
RUN git clone --depth 1 https://github.com/gavinhoward/bc.git bc-gh
WORKDIR bc-gh
COPY build.sh $SRC/
21 changes: 21 additions & 0 deletions projects/bc-gh/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -eu
# Copyright 2024 Google LLC
#
# 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.
#
################################################################################

./configure -Z
make -j$(nproc) all

cp bin/*_fuzzer_* $OUT/
6 changes: 6 additions & 0 deletions projects/bc-gh/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ homepage: https://git.gavinhoward.com/gavin/bc
main_repo: https://github.com/gavinhoward/bc
language: c
primary_contact: [email protected]
fuzzing_engines:
- libfuzzer
- afl
- honggfuzz
- centipede
disabled: true

0 comments on commit edfa5f6

Please sign in to comment.