Skip to content

Certain content is truncated upon read, on Windows #223

@berdario

Description

@berdario

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions