You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This does not reliably cause an exception to be thrown because repeatedly closing a Reader is fine as per the Java spec, but I believe it should still be addressed.
The text was updated successfully, but these errors were encountered:
spalac24
added a commit
to spalac24/univocity-parsers
that referenced
this issue
Oct 19, 2021
Hi,
I believe I found a data race in ConcurrentCharLoader.java , which can be triggered by default normal use of the CsvParser library.
Here's a sample minimal code that triggers the issue: https://gist.github.com/spalac24/0256b40b1d6652fdb30e91624f7b5ed0
In short, that code causes
stopReading()
to be called both from https://github.com/uniVocity/univocity-parsers/blob/master/src/main/java/com/univocity/parsers/common/input/concurrent/ConcurrentCharLoader.java#L101 (which runs in its own thread by default) and https://github.com/uniVocity/univocity-parsers/blob/master/src/main/java/com/univocity/parsers/common/input/concurrent/ConcurrentCharInputReader.java#L85 concurrently, butstopReading()
is not thread safe.This does not reliably cause an exception to be thrown because repeatedly closing a
Reader
is fine as per the Java spec, but I believe it should still be addressed.The text was updated successfully, but these errors were encountered: