Skip to content

Commit

Permalink
Bug fix for a possible deadlock
Browse files Browse the repository at this point in the history
If a pcap load is issued while another is in progress, the first pcap
must be stopped. But this callback doesn't close a channel; instead it
adds the close to a callback issued via app.Run. But this can leave the
main select loop blocked in the flow of control from a message on the
operations channel because control will never return to allow the
closure queued up for app.Run to be executed.
  • Loading branch information
gcla committed Jul 27, 2020
1 parent afd03cd commit b671ee3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,8 @@ func (t updatePacketViews) OnClear(closeMe chan<- struct{}) {
}

func (t updatePacketViews) BeforeBegin(ch chan<- struct{}) {
close(ch)
ch2 := Loader.PsmlFinishedChan

t.App.Run(gowid.RunFunction(func(app gowid.IApp) {
clearPacketViews(app)
t.Ld.Lock()
Expand All @@ -1173,8 +1173,6 @@ func (t updatePacketViews) BeforeBegin(ch chan<- struct{}) {
time.Duration(2000)*time.Millisecond,
10)
}, Goroutinewg)

close(ch)
}))
}

Expand Down

0 comments on commit b671ee3

Please # to comment.