From 58924941cce8ea5d7be1d29a313e14e1c506c5db Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 2 Jul 2018 17:00:00 +0200 Subject: pkg/report: fix race on symbolizer in test Symbolizer is not meant to be invoked with an empty binary. --- pkg/report/fuchsia.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/report/fuchsia.go b/pkg/report/fuchsia.go index 419f0dd07..8e8b1a7b2 100644 --- a/pkg/report/fuchsia.go +++ b/pkg/report/fuchsia.go @@ -46,9 +46,11 @@ var ( func ctorFuchsia(kernelSrc, kernelObj string, ignores []*regexp.Regexp) (Reporter, []string, error) { ctx := &fuchsia{ - obj: filepath.Join(kernelObj, "zircon.elf"), ignores: ignores, } + if kernelObj != "" { + ctx.obj = filepath.Join(kernelObj, "zircon.elf") + } suppressions := []string{ "fatal exception: process /tmp/syz-fuzzer", // OOM presumably } @@ -114,6 +116,9 @@ func (ctx *fuchsia) Parse(output []byte) *Report { func (ctx *fuchsia) processPC(rep *Report, symb *symbolizer.Symbolizer, line []byte, match []int, call bool, where *string) bool { + if ctx.obj == "" { + return false + } prefix := line[match[0]:match[1]] pcStart := match[2] - match[0] pcEnd := match[3] - match[0] -- cgit mrf-deployment