cosim-demo-app icon indicating copy to clipboard operation
cosim-demo-app copied to clipboard

Crash when removing variables from trend

Open eidekrist opened this issue 6 years ago • 1 comments

When removing variables from trend, an exceptional situation may arise.

The operation clears the slice structs.SimulationStatus.TrendSignals. If the program is simultaneously iterating over this slice (fetching time series), the program may go down due to an out of bounds exception.

This was previously solved with a mutex which made things horribly sluggish at times.

eidekrist avatar Feb 06 '19 15:02 eidekrist

panic: runtime error: index out of range

goroutine 51 [running]:
cse-server-go/cse.removeAllFromTrend(0xc00014a050, 0xc000438080, 0x81ff71, 0x1, 0x0, 0x0, 0xc000431d48)
        D:/JenkinsOSP/workspace/on-platform_cse-server-go_v0.5.0/src/cse-server-go/cse/trending.go:82 +0x383
cse-server-go/cse.executeCommand(0xc000004040, 0x2, 0x2, 0xc00014a050, 0xc000438080, 0xc000d941d0, 0xb, 0x0, 0x0, 0x0, ...)
        D:/JenkinsOSP/workspace/on-platform_cse-server-go_v0.5.0/src/cse-server-go/cse/cse.go:625 +0x528
cse-server-go/cse.CommandLoop(0xc00013a0c0, 0xc00014a050, 0xc00013a060, 0xc000438080)
        D:/JenkinsOSP/workspace/on-platform_cse-server-go_v0.5.0/src/cse-server-go/cse/cse.go:679 +0xb8
created by main.main
        D:/JenkinsOSP/workspace/on-platform_cse-server-go_v0.5.0/src/cse-server-go/main.go:25 +0x222 

eidekrist avatar Oct 14 '19 13:10 eidekrist