david415 / HoneyBadger

Quantum Insert detector/recorder
GNU General Public License v3.0
305 stars 39 forks source link

dispatcher/close connection data race #49

Closed david415 closed 9 years ago

david415 commented 9 years ago
==================
WARNING: DATA RACE
Read by goroutine 14:
  github.com/david415/HoneyBadger.(*Connection).receivePacketState()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/state_machine.go:632 +0x1c6
  github.com/david415/HoneyBadger.(*Connection).startReceivingPackets()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/state_machine.go:651 +0x99

Previous write by goroutine 8:
  github.com/david415/HoneyBadger.(*Connection).Close()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/state_machine.go:218 +0x60
  github.com/david415/HoneyBadger.(*Inquisitor).dispatchPackets()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/packet_dispatcher.go:188 +0x121

Goroutine 14 (running) created at:
  github.com/david415/HoneyBadger.(*Connection).Start()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/state_machine.go:213 +0x40
  github.com/david415/HoneyBadger.(*Inquisitor).setupNewConnection()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/packet_dispatcher.go:174 +0x4b1
  github.com/david415/HoneyBadger.(*Inquisitor).dispatchPackets()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/packet_dispatcher.go:210 +0x6d3

Goroutine 8 (running) created at:
  github.com/david415/HoneyBadger.(*Inquisitor).Start()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/packet_dispatcher.go:89 +0x6b
  github.com/david415/HoneyBadger.BadgerSupervisor.Run()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/supervisor.go:66 +0x136
  github.com/david415/HoneyBadger.SetupAttackDetectionPcapInquisitor()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/pcap_integration_test.go:73 +0x31e
  github.com/david415/HoneyBadger.PcapIsDetectInjection()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/pcap_integration_test.go:79 +0xd1
  github.com/david415/HoneyBadger.func��003()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/pcap_integration_test.go:101 +0x235
  path/filepath.walk()
      /home/user/go/src/path/filepath/path.go:347 +0xa1
  path/filepath.walk()
      /home/user/go/src/path/filepath/path.go:372 +0x61a
  path/filepath.walk()
      /home/user/go/src/path/filepath/path.go:372 +0x61a
  path/filepath.Walk()
      /home/user/go/src/path/filepath/path.go:394 +0x117
  github.com/david415/HoneyBadger.TestAllPcapFiles()
      /home/user/go/gopath/src/github.com/david415/HoneyBadger/pcap_integration_test.go:107 +0x293
  testing.tRunner()
      /home/user/go/src/testing/testing.go:447 +0x133
==================
david415 commented 9 years ago

fix for now with single goroutine dispatcher design https://github.com/david415/HoneyBadger/commit/843daa330fdf468ddabc60be5824ac87ff12da8b