fatal error: concurrent map read and map write
gongchengjinlove opened this issue · 1 comments
fatal error: concurrent map read and map write
goroutine 1903 [running]:
github.com/gojue/ebpfmanager.GetSyscallFnNameWithSymFile({0xf77c59, 0xb}, {0x0?, 0x11?})
/opt/GOPATH/pkg/mod/github.com/gojue/ebpfmanager@v0.4.1/utils.go:130 +0x285
github.com/gojue/ebpfmanager.(*Probe).init(0xc002e1a000)
/opt/GOPATH/pkg/mod/github.com/gojue/ebpfmanager@v0.4.1/probe.go:390 +0x733
github.com/gojue/ebpfmanager.(*Probe).Init(0xc002e1a000, 0xc0004b01c0?)
/opt/GOPATH/pkg/mod/github.com/gojue/ebpfmanager@v0.4.1/probe.go:317 +0xab
github.com/gojue/ebpfmanager.(*Manager).loadCollection(0xc0004b01c0)
/opt/GOPATH/pkg/mod/github.com/gojue/ebpfmanager@v0.4.1/manager.go:1351 +0x2c5
github.com/gojue/ebpfmanager.(*Manager).InitWithOptions(, {, _}, {{0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...})
/opt/GOPATH/pkg/mod/github.com/gojue/ebpfmanager@v0.4.1/manager.go:554 +0x497
env:
go version go1.20.2 linux/amd64
ebpfmanager@v0.4.1
utils.go
var kallsymsCache use not safe for goroutine map. maby we need use sync.Map
ebpfmanager@v0.4.1 utils.go kallsymsCache 使用了非goroutine 安全的map, 并发使用时引起panic, 建议使用sync.Map
Thank you for the feedback, I will resolve this issue over the weekend.
感谢反馈,我将在周末解决这个问题。