Commit Graph

74 Commits

Author SHA1 Message Date
Jonathan Metzman c136dd660b Fix bug where region count was used to determine if file was covered
instead of region coverage.
Add a test for this.
Add a remove_prefix util function.
2021-01-20 10:13:42 -08:00
Jonathan Metzman fe7b56af48 fmt/lnt 2021-01-20 08:48:29 -08:00
Jonathan Metzman 95f1089d7a fmt 2021-01-20 08:48:02 -08:00
Jonathan Metzman a00890cb73 more tests 2021-01-20 08:46:38 -08:00
Jonathan Metzman dafddab431 move more tests 2021-01-20 08:22:24 -08:00
Jonathan Metzman 8cda07fb9f move over test 2021-01-20 07:59:32 -08:00
Jonathan Metzman 913962ba54 Add coverage_test module and fmt/lnt 2021-01-20 07:38:27 -08:00
Jonathan Metzman 9935321c0d fmt/lnt 2021-01-20 07:26:02 -08:00
Jonathan Metzman ddb0add036 fuzzers->fuzz targets and finish affected_fuzz_targets module 2021-01-20 07:25:08 -08:00
Jonathan Metzman 0be9a235b8 merge 2021-01-20 07:02:39 -08:00
Jonathan Metzman 50109305cb New module for affected fuzz targets 2021-01-20 06:56:13 -08:00
Jonathan Metzman cb262dfbcb fmt/lnt 2021-01-20 06:51:30 -08:00
Jonathan Metzman 2ce7db4d47 Refactor coverage and move to own module 2021-01-20 06:47:48 -08:00
jonathanmetzman b9094ea003
[CIFuzz][NFC] Refactor affected fuzzers and improve logging (#5006)
1. Add a get_affected_fuzzers function.
2. Add comments explaining rationales.
3. Fix logging so that each affected fuzzer is only logged once.
4. Don't put each file affecting each fuzzer on its own line, this makes logs unreadable.
5. Improve logging wording.
2021-01-20 06:41:39 -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
jonathanmetzman 96b8aad56a
[CIFuzz] Fix MSAN (#4812)
Use msan libs when building fuzzers with MSAN.
2020-12-10 06:24:48 -08: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
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 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
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 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
jonathanmetzman 640a9c2bcf
Fix test_all breakage (#4673)
Specify fuzzing language.
Intended to fix https://github.com/google/oss-fuzz/issues/4672
2020-11-20 07:24:06 -08:00
jonathanmetzman f3c0204d10
[NFC][CIFuzz] Fix coding issues. (#4550)
Fix some coding and style issues.
1. Treat "testcase" as one word. This is consistent with ClusterFuzz.
2. Treat "stacktrace" as one word. This is consistent with ClusterFuzz.
3. Fix spelling of comments and words in code.
4. Use descriptive style docstrings and remove unnecessary clutter
(e.g. "Test the functionality of foo_function function in bar module"
becomes "Tests foo_function."
5. Use JSON for a list needed in testing instead of pickle.
2020-11-17 13:39:57 -08:00
jonathanmetzman 8daba1a1a1
[CIFuzz] Don't assume fuzzer output is ASCII (#4537)
[CIFuzz] Don't assume fuzzer output is ascii

This is wrong because the output can be arbitrary. Instead change
code that deals with the output to deal with bytes. The testcase,
which is derived from the output can be decoded as UTF-8 since it
will be a unix path.
2020-10-19 10:10:22 -07:00
jonathanmetzman 449ef28a87
[CIFuzz] Retry HTTP requests on certain errors (#4516)
Skia has seen some unhandled connection reset errors.
When we see these errors when downloading old OSS-Fuzz build, retry downloading it, since the error is likely transient.
2020-10-12 07:50:38 -07:00
jonathanmetzman 571dbfb39f
Reland 55d9a81. (#4269)
The issue with 55d9a81 that caused it to be reverted by 3370f8f
was probably due to the build trigger on GCB being stale. I've
updated it so this commit should stick.
2020-08-06 14:33:08 -07:00
Evgeny Vereshchagin 3370f8f7e5
Revert "[CIFuzz] Allow supplying a manual source checkout (#4250)" (#4263)
This reverts commit 55d9a81cd7.

Closes https://github.com/google/oss-fuzz/issues/4262
2020-08-06 06:11:59 -07:00
jonathanmetzman 55d9a81cd7
[CIFuzz] Allow supplying a manual source checkout (#4250)
Make CIFuzz building accept an env var `MANUAL_SRC_PATH` that points to a manually prepared checkout of the project-under-tests's source code. This allows projects like Skia which are not on OSS-Fuzz and/or need to make changes to the repo after checking out the right commit to use CIFuzz.
Note that for now we aren't supporting this in GitHub, so projects that need to modify the source after checkout can't use it until
we do support it.

Also, use the local copy of OSS-Fuzz when building cifuzz-base instead of cloning it from GitHub. This makes local debugging/development much easier since it allows one to use CIFuzz with local changes.
2020-08-05 18:45:12 -07:00
Abhishek Arya 21ea9d6e3d
Remove sanitizer validation checks in CIFuzz, (#4131)
Sanitizer validation is not needed and it is hacky code with
no proper yaml parsing. sanitizer attribute is properly
documented.
Fixes #3996.
2020-07-15 13:00:57 -07:00
Oliver Chang 2816e8729c
Fix infra tests. (#4097) 2020-07-10 07:00:02 +10:00
jonathanmetzman cac6118315
[cifuzz] Temporary fix for sanitizer validation. (#3997)
Temporary fix for sanitizer validation.

Our sanitizer validation is hacky and isn't using pyyaml to actually
parse the project.yaml file. Temporarily work around #3996 by not
validating sanitizers if no sanitizers are specified in project.yaml.
2020-06-17 10:32:42 -07:00
Evgeny Vereshchagin 26e8d7c772
[CIFuzz] Add support for different sanitizers (#3969)
* Revert "Revert "[CIFuzz] Add support for different sanitizers (#3516)""

This reverts commit c580d0d626.

* cifuzz: pass "sanitizer" to the "run fuzzer" step

It's a follow-up to https://github.com/google/oss-fuzz/pull/3516 that
should fix https://github.com/google/oss-fuzz/issues/3727.

* [cifuzz] drop a $

That's another follow-up to #3516 that should help to pass sanitizer correctly.
Otherwise, it always falls back to address with:

2020-06-11 21:10:14,852 - root - INFO - $address is not a project sanitizer, defaulting to address.
2020-06-11 18:27:01 -07:00
jonathanmetzman 659d4e8228
Fix CIFuzz issue where targets assumed in OSS-Fuzz build if exists (#3817)
Make some other changes:
1. Refactor fuzz_target.py and fuzz_target_test.py
2. Introduce pyfakefs and parameterized as dependencies and use them
in tests.
3. Fix infra-tests in CI so that they use installed dependencies
2020-05-28 10:14:57 -07:00
Evgeny Vereshchagin 0b35444f73
cifuzz: use pull_request.number instead of GITHUB_REF (#3845)
Closes https://github.com/google/oss-fuzz/issues/3732
2020-05-18 18:37:39 -07:00
Abhishek Arya 8d5aef84db
Use hardcoded FUZZING_LANGUAGE to unbreak CIFuzz. (#3844) 2020-05-18 08:23:28 -07:00
jonathanmetzman 1f533163cc
[CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE (#3726)
Currently we use Github action's inputs as inputs to cifuzz.
This means we need to do an extra step to convert each input into
an env var so our scripts can actually use it.
This is pretty bug prone and unnecessary, we should probably
get rid of this abstraction and switch to encouraging devs to set
the env vars directly.
2020-05-13 12:44:11 -07:00
Evgeny Vereshchagin 8ba4f3a375
cifuzz: upload artifacts only when the "run fuzzers" step fails (#3733)
Closes https://github.com/google/oss-fuzz/issues/3711
2020-04-30 09:40:39 -07:00
Jonathan Metzman c580d0d626 Revert "[CIFuzz] Add support for different sanitizers (#3516)"
This reverts commit 9b30127675.
2020-04-28 14:38:10 -07:00
Jonathan Metzman dac83d7b8e Revert "[CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE"
This reverts commit 6f1a7f7911.
2020-04-28 13:37:58 -07:00
Jonathan Metzman 6f1a7f7911 [CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE 2020-04-28 13:36:21 -07:00
Leo Neat 9b30127675
[CIFuzz] Add support for different sanitizers (#3516) 2020-04-28 12:31:36 -07:00
Leo Neat 9d52175ca0
Affected fuzzer fix (#3510)
Fix bug in affected fuzzer caused by miss matched naming. The git diff was returning file paths relative to the root of the project and the coverage files was returning file paths relative to one directory above the project directory.
2020-03-16 12:02:16 -07:00
Leo Neat a1c7499830
[CIFuzz] Logging updates (#3503)
Provide some simple logging updates to assert that affected fuzzers is running correctly.
Also prevents the clouding of longs when the reproduction script runs.
2020-03-16 10:00:56 -07:00
Leo Neat 6f02735d0c
[CIFuzz] Dynamic fuzzer scheduling (#3453)
Allocates time for fuzzers based on amount of fuzzing time left. This is beneficial when a fuzzer fails early in its allotted time because of a reproducible OSS-Fuzz bug. It will then give the remaining portion of its allotted time to the following fuzzers.
2020-03-13 10:35:33 -07:00
Leo Neat b6a1d4dcb1
Revert "Revert "[CIFuzz] Affected fuzzers (#3450)" (#3488)" (#3496)
This reverts commit e58ee49e20.
2020-03-12 13:51:33 -07:00
Leo Neat b0cd13e3bb
Affected fuzzer fix (#3494)
Fixing json decode error with affected fuzzer functionality.
2020-03-12 12:01:57 -07:00