Commit Graph

1215 Commits

Author SHA1 Message Date
Abhishek Arya 01ebe8e15f
Don't run test_all on llvm-symbolizer for black box fuzzer projects. (#4873) 2020-12-19 08:20:29 -08:00
jonathanmetzman e01883df1e
[CIFuzz] Fix typo in disabled test (#4871) 2020-12-18 19:29:52 -08:00
jonathanmetzman d8546a88b3
[infra] Mark more tests as integration (#4869) 2020-12-18 10:44:12 -08:00
jonathanmetzman c2165341d2
[presubmit] Support option to run on all files (#4870) 2020-12-18 10:43:22 -08:00
jonathanmetzman 2a1194c939
Improve CIFuzz tests (#4868)
1. Fix problem where permissions were being changed to root by non-root test (test was doing this by invoking test_all.py within docker).
2. Mark tests as integration tests so that cifuzz_test.py can be run in a reasonable amount of time.
3. Prevent some unittests from polluting source repo.
4. Add .venv to .gitignore
5. Rename test_test_all.py to the correctly formatted name "test_all_test.py"
2020-12-18 10:37:56 -08:00
Abhishek Arya f359fd010f Allow none in engine for infra/helper.py 2020-12-17 19:47:03 -08:00
Abhishek Arya 6718fb8bd6
Fix broken blackbox fuzzer projects. (#4865)
* Fix broken blackbox fuzzer projects.

Regression from
https://github.com/google/oss-fuzz/pull/4769/files

* Fix indent.
2020-12-17 16:29:11 -08:00
Abhishek Arya e06d7f0412
Fix incorrect calculation with gcs path for backup corpus. (#4863)
Fixes https://github.com/google/oss-fuzz/issues/4857
2020-12-17 10:57:32 -08:00
Abhishek Arya fba71c70ca
Copy llvm-symbolizer in $OUT, needed for python targets. (#4832) 2020-12-12 18:58:59 -08:00
Abhishek Arya 64b223a8e9
Fix pillow with new atheris changes. (#4826)
* Fix pillow with new atheris changes.

* Fix pillow in ubsan.
2020-12-11 14:35:43 -08:00
Abhishek Arya 0dd7aaca32
Fix atheris integration. (#4824) 2020-12-11 11:38:43 -08:00
jonathanmetzman 96b8aad56a
[CIFuzz] Fix MSAN (#4812)
Use msan libs when building fuzzers with MSAN.
2020-12-10 06:24:48 -08:00
Oliver Chang 84faf55729
Populate a bunch of main_repo values. (#4815)
Also enforce this for future integrations.
2020-12-10 09:49:27 +11:00
Jonathan Metzman ed633664ec fix 2020-12-09 11:47:18 -08:00
jonathanmetzman 265ae85302
[CIFuzz] Fix issue where copied repo is named incorrectly. (#4813)
[CIFuzz] Fix issue where copied repo is named incorrectly.

Make sure the cloned repo is copied correctly to the docker container
E.g. https://github.com/OpenSC/OpenSC should be coiped to $SRC/opensc.

Fixes https://github.com/google/oss-fuzz/issues/4810

Add unittest
2020-12-09 09:55:54 -08:00
jonathanmetzman 301ed831be
Use print for printing stacktrace instead of using log. (#4799)
Use print for printing stacktrace instead of using log.
This makes stacktrace more legible.
Fixes https://github.com/google/oss-fuzz/issues/4649
2020-12-08 09:05:48 -08:00
Oliver Chang a23d9bc6fb
Rename BaseRepoManager -> RepoManager. (#4800)
This was renamed in b0b99d5ccd
2020-12-08 10:01:38 +11:00
Jonathan Metzman e193d59148 Revert "Use print for printing stacktrace instead of using log."
This reverts commit ecffb3f662.

Commit should not have been committed to master.
2020-12-07 14:45:47 -08:00
Jonathan Metzman ecffb3f662 Use print for printing stacktrace instead of using log.
This makes stacktrace more legible.

Fixes https://github.com/google/oss-fuzz/issues/4649
2020-12-07 14:42:49 -08:00
jonathanmetzman b0b99d5ccd
Cifuzz external build (#4656)
* Support building fuzzers for projects outside of OSS-Fuzz
* Use retry wrapper
* Fix some tests.
2020-12-07 10:50:11 -08:00
jonathanmetzman a24cebec02
Make test_all.py return nonzero when there are no fuzzers. (#4796)
Make test_all.py return nonzero when there are no fuzzers.

This matches the previous behavior.
Fixes https://github.com/google/oss-fuzz/issues/4795
2020-12-07 10:16:31 -08:00
jonathanmetzman aecdd9c4e0
Fix helper.py (#4793)
Recently some python3-only code was added. Make code compatible with
Python2. Fixes https://github.com/google/oss-fuzz/issues/4792
2020-12-07 08:05:03 -08:00
Abhishek Arya b9e6a5fc74
Revert msan patch (#4788)
* Revert "Fix msan build breakage. (#4787)"

This reverts commit 8f4d1b237d.

* Revert "Clean up MemorySanitizer library warnings (#4694)"

This reverts commit 6fc050ec9e.
2020-12-04 19:44:46 -08:00
Abhishek Arya 8f4d1b237d
Fix msan build breakage. (#4787)
Regression from
https://github.com/google/oss-fuzz/pull/4694
2020-12-04 19:21:35 -08:00
Abhishek Arya 588336d665
s/test_all/test_all.py for google cloud build. (#4783)
Fixes https://github.com/google/oss-fuzz/issues/4781
2020-12-04 08:26:34 -08:00
Oliver Chang 8bd567697d
build_specified_commit: fallback to oldest integration commit. (#4779)
When we fail a build, we attempt to identify the first OSS-Fuzz commit
prior to the upstream commit date.

If this does not exist, we bailed out. This commit changes it such that
we at least try on the oldest integration commit.
2020-12-04 17:51:31 +11:00
jonathanmetzman b1c77d1fa2
[test_all] Fix issue where CIFuzz may use an empty string for ALLOWED_BROKEN_TARGETS_PERCENTAGE (#4778) 2020-12-03 13:30:03 -08:00
jonathanmetzman c8d2319aa8
[test_all] Rewrite in Python (#4769)
Rewrite test_all in python.
Bash is quite annoying to write and test.
One issue with bash is it is even worse than Python for parallelism (which may be causing #4707).
Rewrite test_all in python and optimize base-runner/Dockerfile for fast development.
Also, combine some docker layers.
2020-12-03 12:52:34 -08:00
David Cook 6fc050ec9e
Clean up MemorySanitizer library warnings (#4694)
* Update infra/base-images/all.sh

Add build of base-sanitizer-libs-builder and msan-libs-builder to this
shell script.

* msan: Don't warn on un-instrumented standard libs

These libraries do not need to be built with instrumentation, because
MemorySanitizer includes interceptors for them.

* Fix indentation

* Add missing docstrings

* Fix unused variable

* Fix invalid names

* Install python-apt on CI

* Revert "Install python-apt on CI"

This reverts commit d3da49cf90.

* Install and use python-apt in system directory

* Revert "Install and use python-apt in system directory"

This reverts commit e0ede101fb.

* Build python-apt from source

* Check out correct version of python-apt

* Fix octal literals

* More indentation fixes

* Add more missing docstrings

* Change variable names of opened files

* Remove unused import

* Ignore lints about package.Package API

* Fix or ignore remaining invalid names

* Fix apparent typo in compiler_wrapper_test.py

-z should precede a keyword, not a long option

* Fix use of xrange

* Style fixes, compiler_wrapper

* Fix apparent error in compiler_wrapper_test.py

Similar to the previous error, the test case would pass "-z
--no-undefined" to the linker. "-z" only has an effect when it is
followed by a keyword, otherwise ld ignores it and prints a warning
message. In this test case, "-z" and "--no-undefined" were passed in two
separate "-Wl," compiler arguments, but they reflect a common issue.

* Add missing license header

* Rename more functions

* Better name for global variable

* Rename methods of Package

* Rename functions in msan_builder.py

* Fix invalid variable names

* Fix useless-object-inheritance

* pylint: Fixes for Package and its subclasses

* Remove unused imports

* Indentation fixes

* Fix too-may-locals error in msan_build.py

* Add missing docstrings
2020-12-03 07:52:36 +11:00
Jakub Jelen f533434871
[helper] Make sure directories are created before they are passed to container engine (podman) (#4763) 2020-12-01 09:12:30 -08:00
Abhishek Arya b4dd4b91de
Enable UBSan for python projects. (#4757)
* Enable UBSan for python projects.

* Update docs.
2020-11-30 13:26:33 -08:00
jonathanmetzman c63ba21574
[helper] Change generate command to use "LLC" instead of "Inc." (#4753)
This reflects the current style:
https://opensource.google/docs/copyright/#the-year
2020-11-30 11:02:31 -08:00
Oliver Chang cf0e9f0b44
Increase threshold for msan calls check in bad_build_check. (#4747)
Honggfuzz calls msan now:
e067013753

Should address #4743.
2020-11-30 18:10:36 +11:00
Abhishek Arya 84616ae4ce
Fix "exec format error" due to incorrect shebang in python target. (#4746) 2020-11-29 18:49:47 -08:00
Abhishek Arya cd9477213a
Fix ujson project and infra/ for python atheris. (#4706) 2020-11-24 11:36:42 -08:00
jonathanmetzman ec5491853d
[infra] Add retry decorator and use it. (#4702) 2020-11-24 09:51:56 -08:00
jonathanmetzman a43c85a54c [CIFuzz] Set CIFUZZ env var when building/checking/running CIFuzz fuzzers. (#4699)
Fixes https://github.com/google/oss-fuzz/issues/4604
2020-11-24 08:10:05 -08:00
jonathanmetzman 4b9b56783d
[cifuzz] disable failing test (#4700) 2020-11-24 08:03:59 -08:00
Catena cyber 181c036c5b
Self-hosts golang scripts for golang coverage (#4698)
* Self-hosts golang scripts for golang coverage

* fixup remove useless readmes

* Update Dockerfile

Co-authored-by: Abhishek Arya <inferno@chromium.org>
2020-11-24 07:37:56 -08:00
jonathanmetzman a85de2b3a7
Make CIFuzz more debuggable by allowing one to run off a branch (#4666)
Make it possible to run CIFuzz from a non-master branch
2020-11-24 06:32:23 -08:00
Catena cyber 831e4cd96a
Golang coverage reports for projects with modules (#4690)
such as coredns
cloning into GOPATH
2020-11-24 05:08:57 -08:00
Catena cyber 91a6a12dbe
Go json coverage (#4689)
* Good fuzz target for golang coverage with modules

* Place target in right directory for go-json-iterator

So that coverage gets access to the right package
2020-11-22 11:05:32 -08:00
Abhishek Arya 57ebc0c76a
Workaround for unbound var GO111MODULE 2020-11-21 09:09:01 -08:00
Catena cyber 2db56c4174
Golang project uses compile_go_fuzzer script (#4685)
* Golang project uses compile_go_fuzzer script

* Kubernetes project uses compile_go_fuzzer script

* Adds golang to ci covergae builds

* fixup

* Golang coverage with go modules

cf coredns project
2020-11-21 07:11:43 -08:00
Max Moroz e534f4fecc
[infra] Save logs when generating code coverage for Go projects (#2817, #2714). (#4683) 2020-11-20 14:02:36 -08:00
Abhishek Arya e7921e7795
Python fuzzing fixes - disable leak checking, remove flags in atheris. (#4681)
* Python fuzzing fixes - disable leak checking, remove flags in atheris.

* Fix flags printing.

* Dont export, use directly.

* Try unset.

* Unset flags when python was built.
2020-11-20 11:10:51 -08:00
Catena cyber c031d50ec9
[infra] Golang coverage summary for each fuzz target (#2817, #2714). (#4671)
* Golang coverage summary for each fuzz target

* Document usage of compile_go_fuzzer

* update the documentation change

Co-authored-by: Max Moroz <mmoroz@chromium.org>
2020-11-20 10:55:33 -08:00
jonathanmetzman ee7031c4a5
Fix permission denied errors on CI in unittests (#4664)
Also remove usrstcp from the repos we do tests since they no longer work with usrstcp (repo history seems to have been rewritten).
2020-11-20 10:39:19 -08:00
jonathanmetzman a28d03be6e
Build base-images before building projects in CI (#4679)
This will help us catch breaking changes to the base-images.
Unfortunately caching seems to fail here when I expect it to help. 
For example, base-builder doesn't build from cache when I do it locally.
This means that every other image I try to build doesn't use the cache. 
That means that base-clang would take forever to rebuild. 
So to compromise, I don't rebuild base-clang here.
This means that this PR won't catch breaking changes to base-image or base-clang that break in base-builder.
But it will catch breaking changes to base-image that break in base-runner and it will catch breaking changes to base-runner and base-builder.
2020-11-20 10:09:17 -08:00
jonathanmetzman 486c1c3e9d
[CI] Build a canary project on infra/ changes. (#4675)
[CI] Build a canary project on infra/ changes.

Build a specific project, sckms, that does msan, ubsan, asan, i386
builds quickly, when infra/ code is changed. This can let us know
when infra/ changes break proper functioning of OSS-Fuzz.
For this to work more thoroughly we also need to rebuild images.
2020-11-20 08:40:47 -08:00