Segfault reading lazy bytestring past 2^18 bytes

这一生的挚爱 提交于 2019-12-08 16:37:19

问题


Consider the following code: http://hpaste.org/90394

I am memory mapping a large 460mb file to a lazy ByteString. The length of the ByteString reports 471053056.

When nxNodeFromID file 110000 is changed to a lower node ID, ie: 10000, it works perfectly. However; as soon as I try and serialize anything past exactly 2^18 bytes (262144) of the ByteString I get Segmentation fault/access violation in generated code and termination.

I'm running Windows and using GHC 7.4.2.

Please advise whether this is my fault, or some issue with the laziness, or, some issue with Haskell.


回答1:


Note that I have updated mmap to correctly include NOINLINE pragma at strategic point in the code. mmap-0.5.9 available for grabs. Let me know if the issue persists. Edit: yes, I'm the author of mmap.



来源:https://stackoverflow.com/questions/17292048/segfault-reading-lazy-bytestring-past-218-bytes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!