-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
We stumbled upon a use case where a csv file had more than 300 empty rows—doing any operation on the file results in a panic due to divbyzero
Version v1.17.10
Sample File that fails
Sample Query that fails
csvq "select h1 from empty"
panic: runtime error: makeslice: cap out of range
goroutine 35 [running]:
github.com/mithrandie/csvq/lib/query.readRecordSet.func1()
github.com/mithrandie/csvq/lib/query/load_view.go:1233 +0x12c
created by github.com/mithrandie/csvq/lib/query.readRecordSet
github.com/mithrandie/csvq/lib/query/load_view.go:1216 +0x17c
We also use this library in an app server and the panic in the load_view.go:1233
goroutine crashes our server as it can't be recovered in the parent goroutine.
As a stop-gap solution, we are patching the library with this fix in our fork https://github.com/deklareddotcom/habu-csvq/pull/1
What are your thoughts on the bug? Please let me know if you have any better suggestions in fixing it - I can help in contributing back
Metadata
Metadata
Assignees
Labels
No labels