Hello,
I'm deriving some features, and some of them that need to use the function "divide" (e.g. {"divide": ["ipTotalLength", "flowDurationMilliseconds"]}) are returning a panic. I don't know if it is expected or if it should be treated by the tool.
I got this error running go-flows on Monday CIC-IDS2017 pcap file (https://www.unb.ca/cic/datasets/ids-2017.html)
The error:
go-flows run features features.json export csv Monday-WorkingHours.csv source libpcap ../pcap-ng/Monday-WorkingHours.pcap;
panic: runtime error: integer divide by zero
goroutine 6 [running]:
github.com/CN-TU/go-flows/modules/features/operations.(*divideFlow).Stop(0xc0000dce40, 0xa0?, 0x0?)
/mnt/extractors/go-flows-master/modules/features/operations/math_generated.go:283 +0x2bc
github.com/CN-TU/go-flows/flows.(*record).stop(0xc000324370, 0xc0?, 0xc0000dc7c0, 0x0?)
/mnt/extractors/go-flows-master/flows/record.go:92 +0x130
github.com/CN-TU/go-flows/flows.(*record).Export(0xc000324370, 0x78?, 0xc0000dc7c0, 0x14cdd00b53b0de28, 0xc0000ee2a0, 0x0)
/mnt/extractors/go-flows-master/flows/record.go:169 +0x7d
github.com/CN-TU/go-flows/flows.(*BaseFlow).Export(0xc0000e0ba0, 0xc8?, 0xc0005c3800?, 0xc0000dc7c0?)
/mnt/extractors/go-flows-master/flows/flow.go:147 +0x3b
github.com/CN-TU/go-flows/packet.(*tcpFlow).Event(0xc0000e0ba0, {0x9503c8?, 0xc0005c3800}, 0xc0000dc7c0)
/mnt/extractors/go-flows-master/packet/flow.go:42 +0x126
github.com/CN-TU/go-flows/flows.(*FlowTable).Event(0xc0000ee2a0, {0x9503c8, 0xc0005c3800})
/mnt/extractors/go-flows-master/flows/table.go:120 +0x22a
github.com/CN-TU/go-flows/packet.NewFlowTable.func2()
/mnt/extractors/go-flows-master/packet/table.go:182 +0x150
created by github.com/CN-TU/go-flows/packet.NewFlowTable
/mnt/extractors/go-flows-master/packet/table.go:171 +0x348
panic: runtime error: integer divide by zero
goroutine 4 [running]:
github.com/CN-TU/go-flows/modules/features/operations.(*divideFlow).Stop(0xc00018b040, 0xe0?, 0x0?)
/mnt/extractors/go-flows-master/modules/features/operations/math_generated.go:283 +0x2bc
github.com/CN-TU/go-flows/flows.(*record).stop(0xc0002685f0, 0xc0?, 0xc0000dc4c0, 0x0?)
/mnt/extractors/go-flows-master/flows/record.go:92 +0x130
github.com/CN-TU/go-flows/flows.(*record).Export(0xc0002685f0, 0x78?, 0xc0000dc4c0, 0x14cdd00b5721e908, 0xc0000ee0e0, 0x0)
/mnt/extractors/go-flows-master/flows/record.go:169 +0x7d
github.com/CN-TU/go-flows/flows.(*BaseFlow).Export(0xc000181080, 0xc8?, 0xc0005fc000?, 0xc0000dc4c0?)
/mnt/extractors/go-flows-master/flows/flow.go:147 +0x3b
github.com/CN-TU/go-flows/packet.(*tcpFlow).Event(0xc000181080, {0x9503c8?, 0xc0005fc000}, 0xc0000dc4c0)
/mnt/extractors/go-flows-master/packet/flow.go:42 +0x126
github.com/CN-TU/go-flows/flows.(*FlowTable).Event(0xc0000ee0e0, {0x9503c8, 0xc0005fc000})
/mnt/extractors/go-flows-master/flows/table.go:120 +0x22a
github.com/CN-TU/go-flows/packet.NewFlowTable.func2()
/mnt/extractors/go-flows-master/packet/table.go:182 +0x150
created by github.com/CN-TU/go-flows/packet.NewFlowTable
/mnt/extractors/go-flows-master/packet/table.go:171 +0x348