Skip to content

When tracking SSL events, there is a concurrency problem in the global map #297

@xih1919

Description

@xih1919

Describe the bug
When tracking SSL events, there is a concurrency problem in the global map

To Reproduce

For servers with a large number of requests, use ./kyanos watch --debug-output, and problems will occur after running for a long time.

Screenshots

Image

The entire uprobe module has global maps in many places, and they may also cause map concurrency problems.

Partial error message:
`
fatal error: concurrent map read and map write

goroutine 1372334 [running]:
kyanos/agent/uprobe.AttachSslUprobe(0x26aea)
/kyanos/agent/uprobe/manager.go:122 +0x14d
kyanos/agent/uprobe.handleSchedExecEvent(0x0?, 0xc016022ec4)
/kyanos/agent/uprobe/manager.go:80 +0x4e
kyanos/agent/uprobe.StartHandleSchedExecEvent.func1.1(0xc016022ec4)
/kyanos/agent/uprobe/manager.go:37 +0x34
created by kyanos/agent/uprobe.StartHandleSchedExecEvent.func1 in goroutine 75
/kyanos/agent/uprobe/manager.go:31 +0x7f

goroutine 1 [select]:
kyanos/agent/render/watch.RunWatchRender({0x1931228, 0xc00005c2c0}, 0xc0004960e0, {0x0, 0x0, {0x0, 0x0}, 0x1, {0x0, 0x0}, ...})
`

Information (please complete the following information):
Linux xxxxx 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions