Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent map write error #372

Closed
vadimalekseev opened this issue Jan 28, 2022 · 0 comments · Fixed by #374
Closed

Concurrent map write error #372

vadimalekseev opened this issue Jan 28, 2022 · 0 comments · Fixed by #374
Labels
bug Something isn't working

Comments

@vadimalekseev
Copy link

To reproduce:

$ go install -v github.com/quasilyte/go-ruleguard/cmd/ruleguard@latest
$ cd some-big-go-repo # I chose the go-ruleguard repository
$ # the next command may complete without error, repeat until you see the stack trace
$ ruleguard -e 'm.Match("$x{}", "make($x)").Where(m["x"].Type.Is("map[$k]$v"))' ./... 
stack trace
fatal error: concurrent map writes

goroutine 1502 [running]:
runtime.throw({0x13be362, 0xc001870000})
/usr/local/opt/go/libexec/src/runtime/panic.go:1198 +0x71 fp=0xc000968c18 sp=0xc000968be8 pc=0x1033b11
runtime.mapassign_faststr(0x16813a0, 0xc000968e28, {0xc001f107ed, 0x1})
/usr/local/opt/go/libexec/src/runtime/map_faststr.go:211 +0x39c fp=0xc000968c80 sp=0xc000968c18 pc=0x10128bc
github.com/quasilyte/go-ruleguard/ruleguard/typematch.(*Pattern).matchIdentical(0xc001176d68, 0x100e170, {0x14307a8, 0x1646160})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/typematch/typematch.go:404 +0x5ee fp=0xc000968d80 sp=0xc000968c80 pc=0x1268dee
github.com/quasilyte/go-ruleguard/ruleguard/typematch.(*Pattern).matchIdentical(0xc001176d68, 0xc000e25a70, {0x1430820, 0xc0012dcc20})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/typematch/typematch.go:458 +0x8ab fp=0xc000968e80 sp=0xc000968d80 pc=0x12690ab
github.com/quasilyte/go-ruleguard/ruleguard/typematch.(*Pattern).MatchIdentical(0xc001176d68, {0x1430820, 0xc0012dcc20})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/typematch/typematch.go:335 +0xd5 fp=0xc000968eb0 sp=0xc000968e80 pc=0x1268575
github.com/quasilyte/go-ruleguard/ruleguard.makeTypeIsFilter.func2(0xc000a74e98)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/filters.go:272 +0x108 fp=0xc000968f30 sp=0xc000968eb0 pc=0x1297208
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).handleMatch(0xc000a74dc0, {0xc0001aa630, 0x5, 0xc001f02b80, {0xc00176f181, 0x2}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:326 +0x111 fp=0xc000969070 sp=0xc000968f30 pc=0x12a8c71
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).runRules.func1({{0x1430140, 0xc000de1c40}, {0xc0011df300, 0x1, 0x8}})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:229 +0xa5 fp=0xc000969118 sp=0xc000969070 pc=0x12a7d25
github.com/quasilyte/gogrep.(*matcher).MatchNode(0xc001e159e0, 0xc000a74e28, {0x1430140, 0xc000de1c40}, 0xc0009691d0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/match.go:69 +0x395 fp=0xc000969188 sp=0xc000969118 pc=0x1277755
github.com/quasilyte/gogrep.(*Pattern).MatchNode(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/gogrep.go:67
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).runRules(0xc000a74dc0, {0x1430140, 0xc000de1c40}, 0xb)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:228 +0x14b fp=0xc000969260 sp=0xc000969188 pc=0x12a7beb
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run.func1({0x1430140, 0xc000de1c40}, 0x1)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:143 +0x33 fp=0xc000969290 sp=0xc000969260 pc=0x12a6ff3
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x1430140, 0xc000de1c40})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:75 +0x85d fp=0xc000969350 sp=0xc000969290 pc=0x12920fd
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x1430488, 0xc0011150e0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:136 +0x4ad fp=0xc000969410 sp=0xc000969350 pc=0x1291d4d
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkExprList(0xc0009699d8, {0xc000de1c80, 0x3, 0xc000969437})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:31 +0x76 fp=0xc000969450 sp=0xc000969410 pc=0x12916d6
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x1430140, 0xc000de1cc0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:79 +0x8b1 fp=0xc000969510 sp=0xc000969450 pc=0x1292151
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x1430730, 0xc0011d9f80})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:126 +0xd2c fp=0xc0009695d0 sp=0xc000969510 pc=0x12925cc
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkExprList(0x142ff10, {0xc0011b28e0, 0x1, 0xc000969640})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:31 +0x76 fp=0xc000969610 sp=0xc0009695d0 pc=0x12916d6
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x142ff10, 0xc000de1d00})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:196 +0x17fe fp=0xc0009696d0 sp=0xc000969610 pc=0x129309e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkStmtList(0x1430000, {0xc000933280, 0x5, 0x203000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:37 +0x76 fp=0xc000969710 sp=0xc0009696d0 pc=0x1291796
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x1430000, 0xc001115170})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:218 +0x195e fp=0xc0009697d0 sp=0xc000969710 pc=0x12931fe
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x14302d0, 0xc0011151a0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:360 +0x7ea fp=0xc000969890 sp=0xc0009697d0 pc=0x129208a
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkDeclList(0xc0009699d8, {0xc0002a3e00, 0xf, 0xc0005f22c1})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:43 +0x76 fp=0xc0009698d0 sp=0xc000969890 pc=0x1291856
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0009699d8, {0x1430280, 0xc000933500})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:367 +0x109e fp=0xc000969990 sp=0xc0009698d0 pc=0x129293e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).Walk(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:20
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run(0xc000a74dc0, 0xc000933500)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:142 +0x1d5 fp=0xc000969a50 sp=0xc000969990 pc=0x12a6ed5
github.com/quasilyte/go-ruleguard/ruleguard.(*engine).Run(0x0, 0x10, 0x17175b8, 0x10)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/engine.go:127 +0x45 fp=0xc000969a88 sp=0xc000969a50 pc=0x1293e65
github.com/quasilyte/go-ruleguard/ruleguard.(*Engine).Run(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ruleguard.go:74
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6d2b0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:138 +0x2a5 fp=0xc000969b00 sp=0xc000969a88 pc=0x12b6705
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0013c1ea0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e fp=0xc000969ef0 sp=0xc000969b00 pc=0x131dcde
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce-fm()
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:581 +0x26 fp=0xc000969f08 sp=0xc000969ef0 pc=0x1320846
sync.(*Once).doSlow(0xc0007f5f78, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2 fp=0xc000969f70 sp=0xc000969f08 pc=0x106f6f2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d fp=0xc000969fa0 sp=0xc000969f70 pc=0x131d29d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25 fp=0xc000969fc8 sp=0xc000969fa0 pc=0x131d225
golang.org/x/tools/go/analysis/internal/checker.execAll·dwrap·1()
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x2d fp=0xc000969fe0 sp=0xc000969fc8 pc=0x131d1cd
runtime.goexit()
/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000969fe8 sp=0xc000969fe0 pc=0x1065f61
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0x0)
/usr/local/opt/go/libexec/src/runtime/sema.go:56 +0x25
sync.(*WaitGroup).Wait(0x0)
/usr/local/opt/go/libexec/src/sync/waitgroup.go:130 +0x71
golang.org/x/tools/go/analysis/internal/checker.execAll({0xc0012c8400, 0x26, 0x76})
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:576 +0x172
golang.org/x/tools/go/analysis/internal/checker.analyze({0xc001122500, 0x26, 0x1}, {0xc0001ac540, 0x1, 0x13b7b2a})
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:262 +0x1bf
golang.org/x/tools/go/analysis/internal/checker.Run({0xc0000ba070, 0x1, 0x1}, {0xc0001ac540, 0x1, 0x1})
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:137 +0x777
golang.org/x/tools/go/analysis/singlechecker.Main(0x164ad40)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/singlechecker/singlechecker.go:76 +0x22c
main.main()
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/cmd/ruleguard/main.go:9 +0x25

goroutine 1508 [runnable]:
github.com/quasilyte/gogrep.(*matcher).MatchNode(0xc001e15b40, 0xc001e965e8, {0x1430050, 0xc0005d2980}, 0xc001e9f150)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/match.go:40 +0x3c8
github.com/quasilyte/gogrep.(*Pattern).MatchNode(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/gogrep.go:67
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).runRules(0xc001e96580, {0x1430050, 0xc0005d2980}, 0x7)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:228 +0x14b
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run.func1({0x1430050, 0xc0005d2980}, 0x1)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:143 +0x33
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x1430050, 0xc0005d2980})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:116 +0xa4e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x142ffd8, 0xc0004187e0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:131 +0xf3a
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x142ffd8, 0xc000418840})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:130 +0xf0b
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x14303c0, 0xc0005d2ac0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:225 +0x1a65
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkStmtList(0x1430000, {0xc00029a500, 0x1, 0xc001e9f580})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:37 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x1430000, 0xc000418900})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:218 +0x195e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x14303c0, 0xc0005d2b00})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:240 +0x1bce
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkStmtList(0x1430000, {0xc0002a2000, 0xb, 0x203000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:37 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x1430000, 0xc000418ff0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:218 +0x195e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc001e9f9d8, {0x14302d0, 0xc000419020})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:360 +0x7ea
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkDeclList(0xc0017bc9d8, {0xc0005d3300, 0x3, 0xc000715fc1})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:43 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017bc9d8, {0x1430280, 0xc00041e100})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:367 +0x109e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).Walk(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:20
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run(0xc001e96580, 0xc00041e100)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:142 +0x1d5
github.com/quasilyte/go-ruleguard/ruleguard.(*engine).Run(0x0, 0x10, 0x17175b8, 0x10)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/engine.go:127 +0x45
github.com/quasilyte/go-ruleguard/ruleguard.(*Engine).Run(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ruleguard.go:74
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6d5f0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:138 +0x2a5
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0011d2280)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0x0, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1504 [runnable]:
syscall.syscall(0x10ac840, 0xa, 0xc000c8e000, 0x570c)
/usr/local/opt/go/libexec/src/runtime/sys_darwin.go:22 +0x3b
syscall.read(0xc000bdf7a0, {0xc000c8e000, 0x90ab160, 0x81})
/usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:1171 +0x49
syscall.Read(...)
/usr/local/opt/go/libexec/src/syscall/syscall_unix.go:189
internal/poll.ignoringEINTRIO(...)
/usr/local/opt/go/libexec/src/internal/poll/fd_unix.go:582
internal/poll.(*FD).Read(0xc000bdf7a0, {0xc000c8e000, 0x570c, 0x570c})
/usr/local/opt/go/libexec/src/internal/poll/fd_unix.go:163 +0x285
os.(*File).read(...)
/usr/local/opt/go/libexec/src/os/file_posix.go:32
os.(*File).Read(0xc0002c4898, {0xc000c8e000, 0x0, 0x10e23a0})
/usr/local/opt/go/libexec/src/os/file.go:119 +0x5e
os.ReadFile({0xc0002a4de0, 0x18da})
/usr/local/opt/go/libexec/src/os/file.go:699 +0x1fb
io/ioutil.ReadFile(...)
/usr/local/opt/go/libexec/src/io/ioutil/ioutil.go:37
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).fileBytes(0xc00137a580)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:116 +0x51
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).nodeText(0xc00137a580, {0x1430140, 0xc0008c5000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:92 +0x1f0
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).renderMessage(0x1431ad0, {0xc00176f181, 0x2}, {0x1431ad0, 0xc000db6d80}, 0x1)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:375 +0xc8
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).handleMatch(0xc00137a580, {0xc0001aa630, 0x5, 0xc001f02b80, {0xc00176f181, 0x2}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:333 +0x1b4
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).runRules.func1({{0x1430140, 0xc0008c5000}, {0xc000b00f00, 0x1, 0x8}})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:229 +0xa5
github.com/quasilyte/gogrep.(*matcher).MatchNode(0xc001e159e0, 0xc00137a5e8, {0x1430140, 0xc0008c5000}, 0xc000c87450)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/match.go:69 +0x395
github.com/quasilyte/gogrep.(*Pattern).MatchNode(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/gogrep.go:67
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).runRules(0xc00137a580, {0x1430140, 0xc0008c5000}, 0xb)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:228 +0x14b
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run.func1({0x1430140, 0xc0008c5000}, 0xc0007c76e0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:143 +0x33
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c879d8, {0x1430140, 0xc0008c5000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:75 +0x85d
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkExprList(0x142ff10, {0xc000b4e1e0, 0x1, 0xc000c87640})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:31 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c879d8, {0x142ff10, 0xc0008c5040})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:196 +0x17fe
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkStmtList(0x1430000, {0xc000944200, 0x6, 0x203000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:37 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c879d8, {0x1430000, 0xc001300000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:218 +0x195e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c879d8, {0x14302d0, 0xc001300030})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:360 +0x7ea
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkDeclList(0xc0017b29d8, {0xc001306000, 0x19, 0xc000510a51})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:43 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017b29d8, {0x1430280, 0xc000944c00})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:367 +0x109e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).Walk(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:20
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run(0xc00137a580, 0xc000944c00)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:142 +0x1d5
github.com/quasilyte/go-ruleguard/ruleguard.(*engine).Run(0x0, 0x10, 0x17175b8, 0x10)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/engine.go:127 +0x45
github.com/quasilyte/go-ruleguard/ruleguard.(*Engine).Run(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ruleguard.go:74
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6d450)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:138 +0x2a5
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0011d2000)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0xc000231f78, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1487 [runnable]:
syscall.syscall(0x10acae0, 0x3, 0xc0017c8a38, 0x0)
/usr/local/opt/go/libexec/src/runtime/sys_darwin.go:22 +0x3b
syscall.Fstat(0x1062b4b, 0x0)
/usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:1858 +0x34
os.newFile.func1(...)
/usr/local/opt/go/libexec/src/os/file_unix.go:148
os.ignoringEINTR(...)
/usr/local/opt/go/libexec/src/os/file_posix.go:246
os.newFile(0x3, {0xc0005e26e0, 0x4d}, 0x1)
/usr/local/opt/go/libexec/src/os/file_unix.go:147 +0x233
os.openFileNolog({0xc0005e26e0, 0x10a1a08}, 0x0, 0x0)
/usr/local/opt/go/libexec/src/os/file_unix.go:241 +0x1be
os.OpenFile({0xc0005e26e0, 0x4d}, 0x0, 0x10e23a0)
/usr/local/opt/go/libexec/src/os/file.go:338 +0x45
os.Open(...)
/usr/local/opt/go/libexec/src/os/file.go:318
os.ReadFile({0xc0005e26e0, 0x88a})
/usr/local/opt/go/libexec/src/os/file.go:670 +0x6a
io/ioutil.ReadFile(...)
/usr/local/opt/go/libexec/src/io/ioutil/ioutil.go:37
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).fileBytes(0xc0007b29a0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:116 +0x51
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).nodeText(0xc0007b29a0, {0x1430050, 0xc00100f800})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:92 +0x1f0
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).renderMessage(0x1431ad0, {0xc00176f181, 0x2}, {0x1431ad0, 0xc001072270}, 0x1)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:375 +0xc8
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).handleMatch(0xc0007b29a0, {0xc0001aa630, 0x5, 0xc001f02bb8, {0xc00176f181, 0x2}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:333 +0x1b4
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).runRules.func1({{0x1430050, 0xc00100f800}, {0xc000df4a00, 0x1, 0x8}})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:229 +0xa5
github.com/quasilyte/gogrep.(*matcher).MatchNode(0xc001e15b40, 0xc0007b2a08, {0x1430050, 0xc00100f800}, 0xc0017c91d0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/match.go:69 +0x395
github.com/quasilyte/gogrep.(*Pattern).MatchNode(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/gogrep.go:67
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).runRules(0xc0007b29a0, {0x1430050, 0xc00100f800}, 0x7)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:228 +0x14b
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run.func1({0x1430050, 0xc00100f800}, 0xc00100f740)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:143 +0x33
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x1430050, 0xc00100f800})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:116 +0xa4e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x1430488, 0xc00073b2c0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:136 +0x4ad
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkExprList(0xc0017c99d8, {0xc001327c80, 0x2, 0xc0017c9480})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:31 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x1430140, 0xc00100f840})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:79 +0x8b1
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x1430730, 0xc001327ca0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:126 +0xd2c
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkExprList(0x142ff10, {0xc0010cc9b0, 0x1, 0xc0017c9640})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:31 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x142ff10, 0xc00100f880})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:196 +0x17fe
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkStmtList(0x1430000, {0xc00100fd00, 0x3, 0x203000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:37 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x1430000, 0xc00073b410})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:218 +0x195e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x14302d0, 0xc00073b470})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:360 +0x7ea
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkDeclList(0xc0017c99d8, {0xc0000e3e00, 0x11, 0xc000318ed1})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:43 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc0017c99d8, {0x1430280, 0xc000b55c80})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:367 +0x109e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).Walk(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:20
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run(0xc0007b29a0, 0xc000b55c80)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:142 +0x1d5
github.com/quasilyte/go-ruleguard/ruleguard.(*engine).Run(0x0, 0x10, 0x17175b8, 0x10)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/engine.go:127 +0x45
github.com/quasilyte/go-ruleguard/ruleguard.(*Engine).Run(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ruleguard.go:74
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6cdd0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:138 +0x2a5
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0013c1540)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0xc000695f78, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1500 [runnable]:
sync.runtime_SemacquireMutex(0x203000, 0xe0, 0x203000)
/usr/local/opt/go/libexec/src/runtime/sema.go:71 +0x25
sync.(*Mutex).lockSlow(0x1680158)
/usr/local/opt/go/libexec/src/sync/mutex.go:138 +0x165
sync.(*Mutex).Lock(...)
/usr/local/opt/go/libexec/src/sync/mutex.go:81
github.com/quasilyte/go-ruleguard/analyzer.prepareEngine()
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:151 +0x70
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc0012f16c0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:80 +0x25
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0013c1d60)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0xc0003b6778, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1507 [semacquire]:
sync.runtime_SemacquireMutex(0x200, 0xa0, 0x4)
/usr/local/opt/go/libexec/src/runtime/sema.go:71 +0x25
sync.(*Mutex).lockSlow(0x1680158)
/usr/local/opt/go/libexec/src/sync/mutex.go:138 +0x165
sync.(*Mutex).Lock(...)
/usr/local/opt/go/libexec/src/sync/mutex.go:81
github.com/quasilyte/go-ruleguard/analyzer.prepareEngine()
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:151 +0x70
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6d6c0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:80 +0x25
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0011d21e0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0xc0003c7778, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1510 [semacquire]:
sync.runtime_SemacquireMutex(0x203000, 0x30, 0x203000)
/usr/local/opt/go/libexec/src/runtime/sema.go:71 +0x25
sync.(*Mutex).lockSlow(0x1680158)
/usr/local/opt/go/libexec/src/sync/mutex.go:138 +0x165
sync.(*Mutex).Lock(...)
/usr/local/opt/go/libexec/src/sync/mutex.go:81
github.com/quasilyte/go-ruleguard/analyzer.prepareEngine()
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:151 +0x70
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6d790)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:80 +0x25
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0011d23c0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0xc0003c3f78, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1484 [runnable]:
github.com/quasilyte/go-ruleguard/ruleguard.newNodePath(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/nodepath.go:14
github.com/quasilyte/go-ruleguard/ruleguard.newRulesRunner(0xc001577d40, 0xc000982600, 0xc001f00fa0, 0xc000bec510)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:73 +0xd6
github.com/quasilyte/go-ruleguard/ruleguard.(*engine).Run(0x0, 0x10, 0x17175b8, 0x10)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/engine.go:127 +0x36
github.com/quasilyte/go-ruleguard/ruleguard.(*Engine).Run(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ruleguard.go:74
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6cb60)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:138 +0x2a5
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0013c1360)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0xc00066cf78, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1509 [semacquire]:
sync.runtime_SemacquireMutex(0x200, 0x80, 0x7f)
/usr/local/opt/go/libexec/src/runtime/sema.go:71 +0x25
sync.(*Mutex).lockSlow(0x1680158)
/usr/local/opt/go/libexec/src/sync/mutex.go:138 +0x165
sync.(*Mutex).Lock(...)
/usr/local/opt/go/libexec/src/sync/mutex.go:81
github.com/quasilyte/go-ruleguard/analyzer.prepareEngine()
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:151 +0x70
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc0012f1790)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:80 +0x25
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0011d2320)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0x0, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

goroutine 1506 [runnable]:
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkExprList(0x142ff10, {0xc000ec53a0, 0x1, 0xc000c83640})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:31 +0x66
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c839d8, {0x142ff10, 0xc0008bfac0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:196 +0x17fe
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkStmtList(0x1430000, {0xc000c31300, 0x8, 0x203000})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:37 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c839d8, {0x1430000, 0xc0009219b0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:218 +0x195e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c839d8, {0x14302d0, 0xc0009219e0})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:360 +0x7ea
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walkDeclList(0xc000c839d8, {0xc000c31400, 0x5, 0xc001344e01})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:43 +0x76
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).walk(0xc000c839d8, {0x1430280, 0xc000c31480})
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:367 +0x109e
github.com/quasilyte/go-ruleguard/ruleguard.(*astWalker).Walk(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ast_walker.go:20
github.com/quasilyte/go-ruleguard/ruleguard.(*rulesRunner).run(0xc001e36b00, 0xc000c31480)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/runner.go:142 +0x1d5
github.com/quasilyte/go-ruleguard/ruleguard.(*engine).Run(0x0, 0x10, 0x17175b8, 0x10)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/engine.go:127 +0x45
github.com/quasilyte/go-ruleguard/ruleguard.(*Engine).Run(...)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/ruleguard/ruleguard.go:74
github.com/quasilyte/go-ruleguard/analyzer.runAnalyzer(0xc000d6d1e0)
/Users/valekseev/go/pkg/mod/github.com/quasilyte/[email protected]/analyzer/analyzer.go:138 +0x2a5
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0011d2140)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:691 +0xa1e
sync.(*Once).doSlow(0xc000765f78, 0x1313a40)
/usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/opt/go/libexec/src/sync/once.go:59
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(0x103d4e5)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:579 +0x3d
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0)
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:567 +0x25
created by golang.org/x/tools/go/analysis/internal/checker.execAll
/Users/valekseev/go/pkg/mod/golang.org/x/[email protected]/go/analysis/internal/checker/checker.go:573 +0x168

@quasilyte quasilyte added the bug Something isn't working label Jan 30, 2022
quasilyte added a commit that referenced this issue Jan 30, 2022
This is the same trick we did with gogrep matcher.
The caller is supposed to pass the state that is not
shared between different threads.

For the most use cases, ruleguard has worker/runner based
concurrency, so it's easy to pass this state from the
worker that owns that state and doesn't share it with
other workers.

Also added some E2E tests that compile a ruleguard binary
with `-race` and run it using all test rules over the ruleguard
own source code. If any of these rules cause a data race,
this test fails.

To avoid the slower test times, I removed the `-race` from
the basic test as they do not involve any concurrent behavior
anyway, so it was just a waste of time.

Fixes #372
Fixes #368
quasilyte added a commit that referenced this issue Jan 30, 2022
This is the same trick we did with gogrep matcher.
The caller is supposed to pass the state that is not
shared between different threads.

For the most use cases, ruleguard has worker/runner based
concurrency, so it's easy to pass this state from the
worker that owns that state and doesn't share it with
other workers.

Also added some E2E tests that compile a ruleguard binary
with `-race` and run it using all test rules over the ruleguard
own source code. If any of these rules cause a data race,
this test fails.

To avoid the slower test times, I removed the `-race` from
the basic test as they do not involve any concurrent behavior
anyway, so it was just a waste of time.

Fixes #372
Fixes #368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants