Closed Pesa closed 2 years ago
What NDN-DPDK version or commit SHA are you running?
You can see the NDN-DPDK service version with ndndpdk-ctrl show-version
command or the first line of service logs.
fatal error: concurrent map writes
In Go, it is not allowed to write to a map from multiple goroutines, and it is not allowed to read from a map when another goroutine is writing to it.
Violation of this assumption causes a race condition, which triggers a panic if Go ever finds out.
The map causing this error is most likely portByEthDev
(I can only confirm after you provide version information).
The log snippet shows a memif face is being closed, and another is being opened:
It seems that there are some code paths that access the map without posting the task to the main thread.
{"level":"info","ts":1638833899.0720825,"logger":"main","msg":"NDN-DPDK service starting","version":"v0.0.0-20211025195105-7686941f2f7f","uid":0,"linux":"5.4.0-91-generic","dpdk":"DPDK 21.08.0","spdk":"SPDK v21.07"}
v0.0.0-20211025195105-7686941f2f7f
This is really old version. However, the bug is most likely still in the current codebase. I need to check those race conditions.
I'm seriously concerned about calling a 7-week-old version a "really old version"...
It is old in the sense that a major refactoring has occurred in this package.
In 253fb71aae89800074a1c5528f0e5e86754f2243, portByEthDev
map is replaced by portByEthDevID
array, so that this particular crash would not happen again.
However, I believe there's still race condition in Port.faces
map and possibly other fields of Port
type, so that this issue shall remain open.
Port.faces
race condition is fixed in a0fec5fde7d9c47765f2a8217e372c4534758f4a through sync.Mutex
.