Skip to content

Commit

Permalink
Bug fix - an error in the PDML loader left the process running
Browse files Browse the repository at this point in the history
If the running platform does not have /proc/pid/fdinfo support, the
spinner is used during loading, and this bug leaves the spinner running
indefinitely if there is an error in the generated PDML. I see such an
error on macOS with tshark 3.4.4:

<field name="irc.response" showname="Response: :Samsung.US.SPUNet.org NOTICE Auth :Welcome to \002SPUNet\002!" size="56" pos="54" show=":Samsung.US.SPUNet.org NOTICE Auth :Welcome to �SPUNet�!" value="3a53616d73756e672e55532e5350554e65742e6f7267204e4f544943452041757468203a57656c636f6d6520746f20025350554e65740221">

The 0x02 bytes surrounding SPUNet are not handled by the Go XML parser.
  • Loading branch information
gcla committed Sep 3, 2021
1 parent 9ed046d commit dac296d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pcap/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,8 @@ func (c *PdmlLoader) loadPcapSync(row int, visible bool, ps iPdmlLoaderEnv, cb i
if err != nil {
if !issuedKill && unexpectedPdmlError(err) {
err = fmt.Errorf("Could not read PDML data: %v", err)
issuedKill = true
pdmlCancelFn()
HandleError(PdmlCode, app, err, cb)
}
if err == io.EOF {
Expand All @@ -1101,6 +1103,8 @@ func (c *PdmlLoader) loadPcapSync(row int, visible bool, ps iPdmlLoaderEnv, cb i
if err != nil {
if !issuedKill && unexpectedPdmlError(err) {
err = fmt.Errorf("Could not decode PDML data: %v", err)
issuedKill = true
pdmlCancelFn()
HandleError(PdmlCode, app, err, cb)
}
break Loop
Expand Down

0 comments on commit dac296d

Please sign in to comment.