New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 846054 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocked on:
issue 851337



Sign in to add a comment

Roll libFuzzer and remove sanitizer coverage from use_clang_coverage=true builds

Project Member Reported by mmoroz@chromium.org, May 23 2018

Issue description

Owner: mmoroz@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by mmoroz@chromium.org, Jun 21 2018

Blockedon: 851337
Missed that issue! The roll is done: https://chromium-review.googlesource.com/c/chromium/src/+/1092876

The second part is blocker on  issue 851337 .

Comment 3 by mmoroz@chromium.org, Jun 22 2018

Status: Started (was: Assigned)
See c#10 and c#11 in  issue 851337  for some examples showing that build time and build sizes reduce by 2x when we disable sanitizer coverage.

As for the runtime, for fuzz targets it also seems to be 2x speed up at least:

(with and w/o sancov builds are running over the same corpus with -runs=0)

# a bit more than 2x with blink_json_parser_fuzzer:
## with sancov: 
Done 2025 runs in 15 second(s)
stat::number_of_executed_units: 2025
stat::average_exec_per_sec:     135
stat::new_units_added:          0
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              136

## w/o sancov: 
Done 2025 runs in 7 second(s)
stat::number_of_executed_units: 2025
stat::average_exec_per_sec:     289
stat::new_units_added:          0
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              85
----------------------------------------
# almost 6x with net_reporting_header_parser_fuzzer:
## with sancov:
Done 910222 runs in 250 second(s)
stat::number_of_executed_units: 910222
stat::average_exec_per_sec:     3640
stat::new_units_added:          0
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              304

## w/o sancov:
Done 910222 runs in 42 second(s)
stat::number_of_executed_units: 910222
stat::average_exec_per_sec:     21671
stat::new_units_added:          0
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              297
----------------------------------------
# 2.25x with media_cenc_utils_fuzzer:
## with sancov:
Done 910760 runs in 102 second(s)
stat::number_of_executed_units: 910760
stat::average_exec_per_sec:     8929
stat::new_units_added:          0
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              295

## w/o sancov:
Done 910760 runs in 45 second(s)
stat::number_of_executed_units: 910760
stat::average_exec_per_sec:     20239
stat::new_units_added:          0
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              290

I am crazy excited about this change now, should speed things a lot and also not have to worry about coming close to local pd size.

Comment 5 by mmoroz@chromium.org, Jun 22 2018

Yeah, me too!

Running net_unittests w/o sancov:

Tests took 306 seconds.

real	5m9.003s
user	29m21.456s
sys	5m43.512s

with sancov:

Tests took 326 seconds.

real	5m32.794s
user	50m11.140s
sys	6m33.436s

Based on user mode time spent I'd guess it's 2x as well. The total tile is still huge probably due to network latency in the tests.




app_shell_unittests also shows 2x at least:

real	0m10.579s
user	0m0.632s
sys	0m10.504s

vs

real	0m22.715s
user	0m1.216s
sys	0m20.196s


I've tried running browser_tests, but those are so slow anyway so I don't really want to do it on my machine. I've run some part of them and nothing looked bad, so I think we're good to land the change and will see the overall speedup based on logs from the code coverage bots.

Comment 6 by mmoroz@chromium.org, Jun 22 2018

FTR, I copied some timestamps from the bots logs that could be used to compare against:

mmoroz@code-coverage-linux-0002:~$ cat ../coverage-bot/bot.log | egrep '^### (Start|End)'
...
### Start /home/coverage-bot/scripts/code_coverage_loop.bash at Wed Jun 20 01:22:23 UTC 2018
### Start /home/coverage-bot/scripts/build_targets.bash at Wed Jun 20 01:23:14 UTC 2018
### End /home/coverage-bot/scripts/build_targets.bash at Wed Jun 20 05:37:46 UTC 2018
### Start /home/coverage-bot/scripts/run_test_targets.bash at Wed Jun 20 05:37:46 UTC 2018
### End /home/coverage-bot/scripts/run_test_targets.bash at Wed Jun 20 08:09:02 UTC 2018
### Start /home/coverage-bot/scripts/run_fuzz_targets.bash at Wed Jun 20 08:09:02 UTC 2018
### End /home/coverage-bot/scripts/run_fuzz_targets.bash at Wed Jun 20 12:11:57 UTC 2018
### Start /home/coverage-bot/scripts/run_layout_tests.bash at Wed Jun 20 12:11:57 UTC 2018
### End /home/coverage-bot/scripts/run_layout_tests.bash at Wed Jun 20 15:51:21 UTC 2018
### End /home/coverage-bot/scripts/code_coverage_loop.bash at Wed Jun 20 19:30:31 UTC 2018

### Start /home/coverage-bot/scripts/code_coverage_loop.bash at Wed Jun 20 19:30:31 UTC 2018
### Start /home/coverage-bot/scripts/build_targets.bash at Wed Jun 20 19:32:52 UTC 2018
### End /home/coverage-bot/scripts/build_targets.bash at Wed Jun 20 23:53:42 UTC 2018
### Start /home/coverage-bot/scripts/run_test_targets.bash at Wed Jun 20 23:53:42 UTC 2018
### End /home/coverage-bot/scripts/run_test_targets.bash at Thu Jun 21 02:42:26 UTC 2018
### Start /home/coverage-bot/scripts/run_fuzz_targets.bash at Thu Jun 21 02:42:26 UTC 2018
### End /home/coverage-bot/scripts/run_fuzz_targets.bash at Thu Jun 21 06:15:43 UTC 2018
### Start /home/coverage-bot/scripts/run_layout_tests.bash at Thu Jun 21 06:15:43 UTC 2018
### End /home/coverage-bot/scripts/run_layout_tests.bash at Thu Jun 21 09:53:00 UTC 2018
### End /home/coverage-bot/scripts/code_coverage_loop.bash at Thu Jun 21 13:36:04 UTC 2018

### Start /home/coverage-bot/scripts/code_coverage_loop.bash at Thu Jun 21 13:36:04 UTC 2018
### Start /home/coverage-bot/scripts/build_targets.bash at Thu Jun 21 13:38:30 UTC 2018
### End /home/coverage-bot/scripts/build_targets.bash at Thu Jun 21 17:58:05 UTC 2018
### Start /home/coverage-bot/scripts/run_test_targets.bash at Thu Jun 21 17:58:05 UTC 2018
### End /home/coverage-bot/scripts/run_test_targets.bash at Thu Jun 21 21:08:51 UTC 2018
### Start /home/coverage-bot/scripts/run_fuzz_targets.bash at Thu Jun 21 21:08:51 UTC 2018
### End /home/coverage-bot/scripts/run_fuzz_targets.bash at Fri Jun 22 00:26:33 UTC 2018
### Start /home/coverage-bot/scripts/run_layout_tests.bash at Fri Jun 22 00:26:33 UTC 2018
### End /home/coverage-bot/scripts/run_layout_tests.bash at Fri Jun 22 04:03:09 UTC 2018
### End /home/coverage-bot/scripts/code_coverage_loop.bash at Fri Jun 22 07:47:28 UTC 2018

code_coverage_loop.bash | 18h08m | 18h06m | 18h07m
--------------------------------------------------
build_targets.bash      |  4h14m |  4h21m |  4h20m
run_test_targets.bash   |  2h32m |  2h49m |  3h10m
run_fuzz_targets.bash   |  4h02m |  3h33m |  3h18m
run_layout_tests.bash   |  3h40m |  3h38m |  3h37m
generation & uploading  |  3h39m |  3h43m |  3h50m
Project Member

Comment 7 by bugdroid1@chromium.org, Jun 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bcf4673e711696b626af3387858dcd5bc52a7ce7

commit bcf4673e711696b626af3387858dcd5bc52a7ce7
Author: Max Moroz <mmoroz@chromium.org>
Date: Fri Jun 22 21:24:01 2018

Sanitizers: explicitly disable use_sanitizer_coverage when use_clang_coverage=true.

A follow-up for https://chromium-review.googlesource.com/c/chromium/src/+/1112199.
These two changes should significantly speed up code coverage builds. Build time,
binary sizes and runtime all get improved by ~2x. See the other CL description and
the bugs referenced for more precise numbers and targets tested.

We already have an assertion against enabling both use_sanitizer_coverage and
use_clang_coverage via GN args, but the former still could be turned on indirectly
if a fuzzing engine is used (e.g. use_libfuzzer or use_afl).

Bug:  846054 
Change-Id: Idcd87a4589eda71e519d382ef235b38cc0984ed3
Reviewed-on: https://chromium-review.googlesource.com/1112305
Reviewed-by: Abhishek Arya <inferno@chromium.org>
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569779}
[modify] https://crrev.com/bcf4673e711696b626af3387858dcd5bc52a7ce7/build/config/sanitizers/sanitizers.gni

Comment 8 by mmoroz@chromium.org, Jun 22 2018

Components: -Tools>Stability>ClusterFuzz Tools>CodeCoverage

Comment 9 by mmoroz@chromium.org, Jun 25 2018

Hm, results from the bots are not so awesome as I expected. Especially tests run time looks weird, I wonder if we had too many retries in those runs. Will check out other bots as well.


### Start /home/coverage-bot/scripts/code_coverage_loop.bash at Sat Jun 23 02:27:09 UTC 2018
### Start /home/coverage-bot/scripts/build_targets.bash at Sat Jun 23 02:29:28 UTC 2018
### End /home/coverage-bot/scripts/build_targets.bash at Sat Jun 23 06:15:49 UTC 2018
### Start /home/coverage-bot/scripts/run_test_targets.bash at Sat Jun 23 06:15:49 UTC 2018
### End /home/coverage-bot/scripts/run_test_targets.bash at Sat Jun 23 09:27:48 UTC 2018
### Start /home/coverage-bot/scripts/run_fuzz_targets.bash at Sat Jun 23 09:27:48 UTC 2018
### End /home/coverage-bot/scripts/run_fuzz_targets.bash at Sat Jun 23 12:30:14 UTC 2018
### Start /home/coverage-bot/scripts/run_layout_tests.bash at Sat Jun 23 12:30:14 UTC 2018
### End /home/coverage-bot/scripts/run_layout_tests.bash at Sat Jun 23 15:08:44 UTC 2018
### End /home/coverage-bot/scripts/code_coverage_loop.bash at Sat Jun 23 18:52:55 UTC 2018

### Start /home/coverage-bot/scripts/code_coverage_loop.bash at Sat Jun 23 18:52:55 UTC 2018
### Start /home/coverage-bot/scripts/build_targets.bash at Sat Jun 23 18:54:57 UTC 2018
### End /home/coverage-bot/scripts/build_targets.bash at Sat Jun 23 22:41:42 UTC 2018
### Start /home/coverage-bot/scripts/run_test_targets.bash at Sat Jun 23 22:41:43 UTC 2018
### End /home/coverage-bot/scripts/run_test_targets.bash at Sun Jun 24 02:02:26 UTC 2018
### Start /home/coverage-bot/scripts/run_fuzz_targets.bash at Sun Jun 24 02:02:26 UTC 2018
### End /home/coverage-bot/scripts/run_fuzz_targets.bash at Sun Jun 24 04:56:36 UTC 2018
### Start /home/coverage-bot/scripts/run_layout_tests.bash at Sun Jun 24 04:56:36 UTC 2018
### End /home/coverage-bot/scripts/run_layout_tests.bash at Sun Jun 24 07:33:45 UTC 2018
### End /home/coverage-bot/scripts/code_coverage_loop.bash at Sun Jun 24 11:21:47 UTC 2018

### Start /home/coverage-bot/scripts/code_coverage_loop.bash at Sun Jun 24 11:21:47 UTC 2018
### Start /home/coverage-bot/scripts/build_targets.bash at Sun Jun 24 11:24:15 UTC 2018
### End /home/coverage-bot/scripts/build_targets.bash at Sun Jun 24 15:11:52 UTC 2018
### Start /home/coverage-bot/scripts/run_test_targets.bash at Sun Jun 24 15:11:52 UTC 2018
### End /home/coverage-bot/scripts/run_test_targets.bash at Sun Jun 24 18:50:11 UTC 2018
### Start /home/coverage-bot/scripts/run_fuzz_targets.bash at Sun Jun 24 18:50:11 UTC 2018
### End /home/coverage-bot/scripts/run_fuzz_targets.bash at Sun Jun 24 21:35:05 UTC 2018
### Start /home/coverage-bot/scripts/run_layout_tests.bash at Sun Jun 24 21:35:05 UTC 2018
### End /home/coverage-bot/scripts/run_layout_tests.bash at Mon Jun 25 00:12:10 UTC 2018
### End /home/coverage-bot/scripts/code_coverage_loop.bash at Mon Jun 25 04:01:12 UTC 2018


Part of the coverage job|  Time spent with sancov  | Time spent w/o sancov    | Improv., % |
------------------------------------------------------------------------------|
code_coverage_loop.bash | 18h08m | 18h06m | 18h07m | 16h25m | 16h28m | 16h40m |     8.83   |
-------------------------------------------------- |----------------------------------------
build_targets.bash      |  4h14m |  4h21m |  4h20m |  3h46m |  3h47m |  3h47m |    12.02   |
run_test_targets.bash   |  2h32m |  2h49m |  3h10m |  3h12m |  3h19m |  3h39m |   -21.56   | ?????
run_fuzz_targets.bash   |  4h02m |  3h33m |  3h18m |  3h03m |  2h54m |  2h45m |    19.82   |
run_layout_tests.bash   |  3h40m |  3h38m |  3h37m |  2h38m |  2h37m |  2h37m |    27.98   |
generation & uploading  |  3h39m |  3h43m |  3h50m |  3h44m |  3h37m |  3h49m |      N/A   |

I wonder if goma managed to confuse by measurements, even though I tried doing them in a different order :( I've just tested building net_unittests without goma, and observed only ~10% build time improvement, which is fine, I guess, but not that exciting, of course.

The tests runtime is definitely confusing, but it seems to be very flaky either way. I should look at the wider range of values, it definitely cannot regress due to my change.

Fuzz targets and layout tests improvements look nice.
Status: Fixed (was: Started)
Will keep an eye on execution times in future. This is fixed either way, as nothing has broken and things work (slightly) faster.

Sign in to add a comment