nrinaudo / kantan.csv

CSV handling library for Scala
http://nrinaudo.github.io/kantan.csv/
Apache License 2.0
345 stars 36 forks source link

StackOverflowError when parsing csv with different then expected cell separator and quoted cells #362

Open marq opened 10 months ago

marq commented 10 months ago

Tested on master (d83a0ac438bb7f2c3a57aef124b1f5edc8ad5dcb) and v0.7.0

new File("/home/x/test2.csv")
      .asCsvReader[(String, String)](CsvConfiguration.rfc)
      .toList
Exception in thread "sbt-bg-threads-1" java.lang.StackOverflowError
    at kantan.csv.engine.InternalReader.hasNextChar(InternalReader.scala:66)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:174)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
    at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
    at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
...

Test csv file: test2.csv