From 789e5a631f90bd99d7e395c8a5675a98ffb52429 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 13 Jun 2022 10:19:41 +0200 Subject: dashboard/app: support . in source file names In some cases Linux build system generates source file names that contain dots, e.g.: arch/x86/kvm/../../../virt/kvm/kvm_main.c Support this in the regexp. --- dashboard/app/app_test.go | 2 ++ dashboard/app/main.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go index bd512c803..b4b07ddae 100644 --- a/dashboard/app/app_test.go +++ b/dashboard/app/app_test.go @@ -695,6 +695,7 @@ func TestLinkifyReport(t *testing.T) { tipc_topsrv_exit_net+0x149/0x340 net/tipc/topsrv.c:715 kernel BUG at fs/ext4/inode.c:2753! pkg/sentry/fsimpl/fuse/fusefs.go:278 +0x384 + kvm_vcpu_release+0x4d/0x70 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3713 arch/x86/entry/entry_64.S:298 ` // nolint: lll @@ -703,6 +704,7 @@ pkg/sentry/fsimpl/fuse/fusefs.go:278 +0x384 tipc_topsrv_exit_net+0x149/0x340 net/tipc/topsrv.c:715 kernel BUG at fs/ext4/inode.c:2753! pkg/sentry/fsimpl/fuse/fusefs.go:278 +0x384 + kvm_vcpu_release+0x4d/0x70 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3713 arch/x86/entry/entry_64.S:298 ` got := linkifyReport([]byte(input), "https://github.com/google/syzkaller", "111222") diff --git a/dashboard/app/main.go b/dashboard/app/main.go index c8dbdd911..1232b52fc 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -1017,7 +1017,7 @@ func linkifyReport(report []byte, repo, commit string) template.HTML { })) } -var sourceFileRe = regexp.MustCompile("( |\t|\n)([a-zA-Z0-9/_-]+\\.(?:h|c|cc|cpp|s|S|go|rs)):([0-9]+)( |!|\t|\n)") +var sourceFileRe = regexp.MustCompile("( |\t|\n)([a-zA-Z0-9/_.-]+\\.(?:h|c|cc|cpp|s|S|go|rs)):([0-9]+)( |!|\t|\n)") func loadFixBisectionsForBug(c context.Context, bug *Bug) ([]*uiCrash, error) { bugKey := bug.key(c) -- cgit mrf-deployment