sbinet/lsst-ccs

fwk: data race when closing

sbinet opened this issue · 0 comments

shutting down (by way of sending SIGINT) a fcs-lpc-bench application results in:

sysbus INFO    recv: name=hpt;hygro=41.646875%; press=950.234375mbar; temp=21.209375C
sysbus INFO    recv: name=hpt;hygro=41.64375%; press=950.234375mbar; temp=21.209375C
^Clpc INFO    stopping app...
canbus INFO    stopping...
sysbus ERROR    received EOF: connection closed
canbus INFO    shutdown...
canbus INFO    closing tcp connection...
canbus INFO    closing tcp server
==================
WARNING: DATA RACE
Read by goroutine 31:
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*cwrapperImpl).Write()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/conn.go:61 +0x49
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).run()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:355 +0x9c1

Previous write by goroutine 78:
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*cwrapperImpl).Close()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/conn.go:85 +0x16d
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).Close()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:337 +0x17a
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).Shutdown()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:176 +0x26f
  github.com/sbinet/lsst-ccs/fwk.Module.Shutdown()
      <autogenerated>:40 +0x6e
  github.com/sbinet/lsst-ccs/fwk.(*App).doSys.func1()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:153 +0x55

Goroutine 31 (running) created at:
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).init()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:324 +0x239b
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).Boot()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:145 +0x2bf
  github.com/sbinet/lsst-ccs/fwk.Module.Boot()
      <autogenerated>:38 +0x6e
  github.com/sbinet/lsst-ccs/fwk.(*App).doSys.func1()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:153 +0x55

Goroutine 78 (finished) created at:
  github.com/sbinet/lsst-ccs/fwk.(*App).doSys()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:154 +0x17c
  github.com/sbinet/lsst-ccs/fwk.(*App).sysShutdown()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:178 +0x5a
  github.com/sbinet/lsst-ccs/fwk.(*App).Run()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:116 +0xdd5
  main.main()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fcs-mgr/fcs-lpc-bench/main.go:39 +0x3ce
==================
canbus ERROR    error sending command Command{quit,}: EOF
==================
WARNING: DATA RACE
Read by goroutine 31:
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*cwrapperImpl).Close()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/conn.go:77 +0xd1
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).run()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:358 +0xc01

Previous write by goroutine 78:
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*cwrapperImpl).Close()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/conn.go:84 +0x150
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).Close()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:337 +0x17a
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).Shutdown()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:176 +0x26f
  github.com/sbinet/lsst-ccs/fwk.Module.Shutdown()
      <autogenerated>:40 +0x6e
  github.com/sbinet/lsst-ccs/fwk.(*App).doSys.func1()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:153 +0x55

Goroutine 31 (running) created at:
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).init()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:324 +0x239b
  github.com/sbinet/lsst-ccs/fwk/drivers/canbus.(*busImpl).Boot()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/drivers/canbus/canbus.go:145 +0x2bf
  github.com/sbinet/lsst-ccs/fwk.Module.Boot()
      <autogenerated>:38 +0x6e
  github.com/sbinet/lsst-ccs/fwk.(*App).doSys.func1()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:153 +0x55

Goroutine 78 (finished) created at:
  github.com/sbinet/lsst-ccs/fwk.(*App).doSys()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:154 +0x17c
  github.com/sbinet/lsst-ccs/fwk.(*App).sysShutdown()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:178 +0x5a
  github.com/sbinet/lsst-ccs/fwk.(*App).Run()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fwk/app.go:116 +0xdd5
  main.main()
      /home/binet/dev/lsst/ccs/go/src/github.com/sbinet/lsst-ccs/fcs-mgr/fcs-lpc-bench/main.go:39 +0x3ce
==================
canbus ERROR    c-wrapper= exit status 255
Found 2 data race(s)

real    0m45.768s
user    0m0.153s
sys 0m0.047s