I don't think this should be possible.  Perhaps your computer is broken.

If you can reproduce the problem with an input file of a mere 100kB, [here's a different computer for you](https://bellard.org/jslinux/).  (Console output is pretty slow, there's only a few megabytes of free space as well).  The output from running your program under `time` will not match real seconds for some reason.  The clipboard text box doesn't accept keyboard input for me (Firefox 53), so I used the right-click menu to copy data in through `/dev/clipboard` as per the FAQ.

I might try running `debsums` or `rpm --verify -a` in this case.  Previously I've had weird behaviour caused by silent disk corruption.