aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-10-18 22:20:26 -0700
committerDmitry Vyukov <dvyukov@google.com>2020-10-19 10:28:24 +0200
commitff4a3345a1b2a40ff1b8b983153d0b1fcc72f1c5 (patch)
treeb47c57cd8e47b1879f80c5a82088efa11bfcdfc0
parentfea47c014be7a00a32ab016b946c0a77f32c1f40 (diff)
pkg/build: omit gvisor platform code from coverage instrumentation
Collecting coverage in platform/ring0 code causes the kvm platform to crash, possibly due torestrictions on the address space that coverage data is violating.
-rw-r--r--CONTRIBUTORS1
-rw-r--r--pkg/build/gvisor.go4
2 files changed, 4 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 7bb381c12..cf33e8b48 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -29,6 +29,7 @@ Google Inc.
Ioana-Ruxandra Stancioi
Stefano Duo
Aleksandr Nogikh
+ Dean Deng
Baozeng Ding
Lorenzo Stoakes
Jeremy Huang
diff --git a/pkg/build/gvisor.go b/pkg/build/gvisor.go
index c3e817b03..45940cd14 100644
--- a/pkg/build/gvisor.go
+++ b/pkg/build/gvisor.go
@@ -21,7 +21,9 @@ func (gvisor gvisor) build(params *Params) error {
args := []string{"build", "--verbose_failures"}
outBinary := ""
if strings.Contains(config, " -cover ") {
- args = append(args, []string{"--collect_code_coverage", "--instrumentation_filter=//pkg/..."}...)
+ args = append(args, []string{
+ "--collect_code_coverage",
+ "--instrumentation_filter=//pkg/...,-//pkg/sentry/platform/..."}...)
}
if strings.Contains(config, " -race ") {
args = append(args, "--features=race", "//runsc:runsc-race")