18字节后的惰性字节串

18字节后的惰性字节串

本文介绍了segfault读取2 ^ 18字节后的惰性字节串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑以下代码: http://hpaste.org/90394

我正在内存中将一个460mb的大文件映射到一个懒惰的ByteString. ByteString报告的长度为471053056.

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

nxNodeFromID file 110000更改为较低的节点ID,即:10000时,它可以正常工作.然而;一旦我尝试对ByteString的2 ^ 18个字节(262144)以外的任何内容进行序列化,我就会得到Segmentation fault/access violation in generated code并终止.

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.

我正在运行Windows并使用GHC 7.4.2.

I'm running Windows and using GHC 7.4.2.

请告知这是我的错,还是懒惰或Haskell的问题.

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

推荐答案

请注意,我已经更新了mmap,以在代码中的战略要点正确地包含NOINLINE编译指示. mmap-0.5.9可用于获取.让我知道问题是否仍然存在.是的,我是mmap的作者.

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. yes, I'm the author of mmap.

这篇关于segfault读取2 ^ 18字节后的惰性字节串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 01:51