Open tsuzu opened 1 day ago
I found a potentical cause.
In doConsole
, ws.Mirror
for conns[0]
is running on another goroutine.
https://github.com/lxc/incus/blob/c2f495057d87624f1fa84d081718323fb011cc71/cmd/incusd/instance_console.go#L290-L327
When consoleDoneCh
is closed before conns[0]
is closed, conns[0].WriteMessage
can be potentially called from two goroutines:
doConsole
goroutine
https://github.com/lxc/incus/blob/c2f495057d87624f1fa84d081718323fb011cc71/cmd/incusd/instance_console.go#L324
and ws.Mirror
goroutine
https://github.com/lxc/incus/blob/c2f495057d87624f1fa84d081718323fb011cc71/shared/ws/rwc.go#L92
so can't we remove the first WriteMessage, which is called without mutex?
Required information
incus info
``` config: cluster.https_address:Issue description
When I opened
Text console
of a VM/Container on Web UI and then moved to another pane likeConfiguration
, incusd crashed with the following output:or
Steps to reproduce
I can reproduce the problem by
Text console
of a containerConfiguration
After some tries, incusd will crash. However, I'm still looking for a way to reproduce this with CLI or a Go program.
Information to attach
[ ] Any relevant kernel output (dmesg
)[ ] Container log (incus info NAME --show-log
)[ ] Container configuration (incus config show NAME --expanded
)[ ] Output of the client with --debugincus monitor --pretty
while reproducing the issue)