Commit Graph

1064 Commits

Author SHA1 Message Date
Evgeny Vereshchagin 25cff8db8e
[util-linux] cover mnt_table_parse_stream (#4032)
* [util-linux] cover mnt_table_parse_stream

Waiting for https://github.com/karelzak/util-linux/pull/1068

* temporarily point OSS-Fuzz to evverx/util-linux

* make sure it can be built with sanitizer=coverage
2020-06-25 15:35:44 -07:00
kabeer27 181812050d
Cloud function for syncing OSS-Fuzz projects (#3538). (#4023)
Integrating the first cloud function i implemented which syncs the project list from github and uploads the list to cloud datastore, which will be used by another cloud function to request builds.

Co-authored-by: Kabeer Seth <kabeerseth@google.com>
2020-06-25 13:41:04 +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
Abhishek Arya 7101ec4d4b
Add Github Actions CI. (#3971) 2020-06-12 14:39:16 -07:00
Abhishek Arya 16a9023078
Add AFL_NO_AFFINITY to run_fuzzer 2020-06-12 09:05:45 -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
Oliver Chang 4a51ecb61f
build_specified_commit: Handle build.sh which are part of upstream repo. (#3932)
This is a best effort attempt to parse the relevant copy command from
the Dockerfile.

Also add a main function to build_specified_commit to make it easier to
test.
2020-06-10 17:12:28 +10:00
Abhishek Arya 1776bd3dec
Install latest cmake, make easy to install i386 packages (#3943)
Fixes #3124, #2751
2020-06-07 17:27:40 -07:00
Oliver Chang 2f1d2ed756
Retry building project images in build_specified_commit. (#3915)
To mitigate transient network issues.
2020-06-01 17:16:15 +10:00
Abhishek Arya faa775d49d
Fix builds_status cron exception. (#3914)
When build log is not found, skip it and avoid 404.
Fixes exception
```
Traceback (most recent call last):
  File "oss-fuzz/infra/gcb/builds_status.py", line 243, in <module>
    main()
  File "oss-fuzz/infra/gcb/builds_status.py", line 228, in main
    status_filename='status.json')
  File "oss-fuzz/infra/gcb/builds_status.py", line 159, in update_build_status
    last_build = find_last_build(builds, project, build_tag_suffix)
  File "oss-fuzz/infra/gcb/builds_status.py", line 102, in find_last_build
    log.download_to_filename(f.name)
  File "/var/jenkins_home/workspace/infra/builds_status/ENV/local/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 565, in download_to_filename
    file_obj, client=client, start=start, end=end)
  File "/var/jenkins_home/workspace/infra/builds_status/ENV/local/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 537, in download_to_file
    _raise_from_invalid_response(exc)
  File "/var/jenkins_home/workspace/infra/builds_status/ENV/local/lib/python2.7/site-packages/google/cloud/storage/blob.py", line 1873, in _raise_from_invalid_response
    raise exceptions.from_http_response(error.response)
google.api_core.exceptions.NotFound: 404 GET https://www.googleapis.com/download/storage/v1/b/oss-fuzz-gcb-logs/o/log-9fca5dab-72bf-4970-9557-86b93ede51e0.txt?alt=media: No such object: oss-fuzz-gcb-logs/log-9fca5dab-72bf-4970-9557-86b93ede51e0.txt
Build step 'Execute shell' marked build as failure
Finished: FAILURE
```
2020-05-31 17:18:19 -07:00
Abhishek Arya cb156403e9
Don't create empty corpus archive as it wont unpack. (#3903) 2020-05-29 10:39:00 -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
Abhishek Arya 37fbb75094
Set up python in one docker layer, remove python deps. (#3893)
* Set up python in one docker layer.

Address review comment in https://github.com/google/oss-fuzz/pull/3890#pullrequestreview-419693856

* Remove all python dependencies, keep build-essential.
2020-05-27 20:48:51 -07:00
Abhishek Arya 4f9383f50c
Remove libbz2-dev dependency installed in base-builder for python3 (#3890)
* Remove libbz2-dev dependency installed in base-builder for python3

Fixes #3888
2020-05-27 15:38:34 -07:00
Oliver Chang 1778067c4b
build_specified_commit: Don't replace gitdir if already relative. (#3875)
Upgraded git broke this.
2020-05-26 16:08:59 +10:00
Abhishek Arya 8ce95adeac
Install Python 3.8.3 on builder image. (#3874)
Part of fixing #3756.
2020-05-25 20:04:20 -07:00
Abhishek Arya d70af2fc96
Don't add sanitizer=coverage in RUSTFLAGS 2020-05-25 12:55:58 -07:00
Oliver Chang 9ac361c149
build_specified_commit: revert to using cp. (#3871)
rsync seems to have disappeared in the latest images somehow, and we
can't rely on it always existing.
2020-05-25 15:49:37 +10:00
Abhishek Arya 854bc5f736
Use latest git version. (#3870)
Adds features needed by firefox and spidermonkey-ufi builds.
2020-05-24 17:39:43 -07:00
Abhishek Arya f8a00efe4c
Don't add Rust sanitizer flags when using ubsan or i386. (#3862)
Rust sanitizer flags are not supported for these configs.
Fixes Cras and ecc-diff-fuzzer builds.
2020-05-21 17:37:02 -07:00
Abhishek Arya 286badcb3a
Remove unneeded RUSTC_BOOTSTRAP since nightly is used 2020-05-21 10:56:02 -07:00
Abhishek Arya ecf3d384fb
Set rust flags always in compile step. (#3859)
This is needed for projects that mix both rust and c/c++.
2020-05-21 10:16:52 -07:00
dependabot[bot] 931b4dea54
Bump httplib2 from 0.11.3 to 0.18.0 in /infra/gcb (#3853)
Bumps [httplib2](https://github.com/httplib2/httplib2) from 0.11.3 to 0.18.0.
- [Release notes](https://github.com/httplib2/httplib2/releases)
- [Changelog](https://github.com/httplib2/httplib2/blob/master/CHANGELOG)
- [Commits](https://github.com/httplib2/httplib2/compare/v0.11.3...v0.18.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-05-20 09:56:41 -07:00
Oliver Chang e8ef609568
Relax project language requirement. (#3846)
This is necessary for the bisector to be able to build older revisions.

Print a warning instead.
2020-05-20 08:17:24 +10: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
Abhishek Arya c066a4232f
Fix missing FUZZING_LANGUAGE in coverage build. (#3843) 2020-05-18 08:12:00 -07:00
Abhishek Arya 9c53cc323a
Add fuzzing language correctly during compile step. (#3837) 2020-05-17 22:13:28 -07:00
Abhishek Arya 3ffe0a9f5a
Add FUZZING_LANGUAGE to build step. (#3835) 2020-05-17 20:39:00 -07:00
Abhishek Arya 22443e5230
Parse project language and use in infra/helper.py (#3834)
* Parse project language and use in infra/helper.py

* Fix exception message.
2020-05-17 19:22:36 -07:00
Oliver Chang 1e83b88e95
Quick fix for helper.py build_fuzzers. (#3832) 2020-05-18 11:02:26 +10:00
Abhishek Arya 4f7cf1b334
Simplify rust project setup. (#3830)
* Simplify rust project setup.

- Add rust and cargo-fuzz in base builder.
- Set RUSTC_BOOSTRAP to make ASan available.
- Set RUSTFLAGS and C,CXXFLAGS properly.
2020-05-17 16:45:54 -07:00
jonathanmetzman 7fb04e4fda
Fix clang updating script to actually track Chrome's (#3806)
Fix clang updating script to actually update clang based on Chrome's

With this change, clang (llvm-project) will be updated from:
e84b7a5fe230e42b8e6fe451369874a773bf1867
to Chrome's current version:
99ac9ce7016d701b43b8f0c308dc3463da57d983.

This commit fixes two bad bugs:
1. Using the output of a command instead of the return code.
2. Using ! to determine whether the command succeeded ! in bash
will do the same thing for 0 and 1.

These bugs were hidden by OUR_LLVM_REVISION which we traditionally
set to the last commit we rolled back to. If this were a comment
instead of stored as a variable that is not supposed to be used
unless FORCE_OUR_REVISION is set, this bug probably could have
been caught earlier. Instead, the code always used the value
provided by this variable.

Fixes https://github.com/google/oss-fuzz/issues/3805
2020-05-13 17:07:18 -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
Oliver Chang 15289d2bc2
Include repo URL in bisection error. (#3795) 2020-05-13 14:38:46 +10:00
Oliver Chang af766f3f2c
bisector: always reset projects/ even when we exception out. (#3769) 2020-05-07 17:19:57 +10:00
Abhishek Arya 881e3638b7
Remove deprecated go-fuzz-build (#3761)
Remove it now to avoid people using it.
2020-05-06 12:11:50 -07:00
Oliver Chang 434109ab61
Use dedup_token_length in bisector. (#3764)
Using whether or not the target crashed is not sufficient. There are
numerous cases where the state changes.
2020-05-06 15:30:16 +10:00
Oliver Chang b16fcfc903
bisector: Properly detect MSan issues as well. (#3762)
Adopt a similar start/end marker approach to CF.
2020-05-06 12:09:51 +10:00
Oliver Chang 2d972c9162
Add a better check for crash during bisection. (#3758) 2020-05-04 16:50:25 +10:00
Oliver Chang 40c64add94
bisector: Increase rsync performance. (#3757) 2020-05-04 12:23:05 +10:00
Oliver Chang 2f1fc1e94f
Raise exception if old_commit has the same behaviour as new_commit. (#3749)
Ignoring it and trying to bisect the entire range up to new_commit is
too slow and does not work well in practice.
2020-05-01 14:01:12 +10: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
Oliver Chang 3a23496fcd
bisector: Sort by timestamp order when getting base-builder tags. (#3740) 2020-04-30 15:50:33 +10:00
Oliver Chang 6b79797ed3
helper: Clean /work as well if --clean is specified. (#3738) 2020-04-30 15:32:17 +10: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
Oliver Chang 174e03249a
bisector: Re-copy /src in between runs. (#3720)
Some builds won't work if there are remaining artifacts in /src.

Also fix a bug from last commit.
2020-04-28 14:26:08 +10:00