-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CSV.Chunks crashing due to finalized buffer
Fixes #734. The issue here is that on windows, we aggressively finalize the file source buffer as a way to "close" the file, since windows is much more picky when trying to modify an mmapped file after parsing. i.e. windows complains if you try to modify a file and there's still an mmap reference to it somewhere, so at the end of CSV.File, we call `finalize(buf)` to ensure it gets unmapped. The problem, however, is that `CSV.Chunks` calls `CSV.File` multiple times on the same `buf`, providing different starting/ending byte positions to read in chunks. So naturally, after the first chunk was read, the buffer was getting finalized and then the 2nd chunk immediately crashed trying to read its chunk from a finalized buffer.
- Loading branch information
Showing
3 changed files
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters