haskell/text

Certain content is truncated upon read, on Windows

berdario opened this issue · 4 comments

@birbacher found an issue when reading certain files on Windows.

We tried with bare hGetContents, we changed the buffering, changed the compilation options -O0, -O1, etc... but haven't yet found a difference.

Adding or removing a single character before the truncation point is enough for the test case to pass, but otherwise it fails every single time.

It seems to only truncate on a line ending after a multiple of 4k (that's why we attempted to change the buffering for it).

I created a small repo with a test case:

https://github.com/berdario/text-bug-repro

https://github.com/berdario/text-bug-repro/blob/master/src/Lib.hs readTheSame is supposed to yield True

And this is the file in question: https://github.com/berdario/text-bug-repro/blob/master/testfile

You can see the failure live here: https://ci.appveyor.com/project/berdario/text-bug-repro/build/1.0.4

@berdario Thanks for the report and re-pro steps! I can reproduce it with both the new and old I/O manager. Will take a look this week.

@Mistuke Hey, brilliant you're going to look into this. This issue has dropped a bit out of sight for me, but I'd be happy to assist if you needed any help. I basically had the issue initially and @berdario had helped me file this issue.

That should fix the problem :)

Thank you @Mistuke !!