Charles-Francois Natali <[email protected]> added the comment:

Could you try with this:

 def setUp(self):
          with open(support.TESTFN, "wb+") as f:
              f.seek(_4G)
              f.write(b"asdf")
              f.flush()
+            os.fsync(f.fileno())
              self.mapping = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)

HFS+ doesn't seem to support sparse files, so the file is actually
zero-filled asynchronously.
Maybe the mapping gets done before the blocks have been allocated,
which triggers a segfault when the first page is accessed.
I'm not sure it'll make any difference, but I'm curious...

Also, I'd be curious to see the result of

"""
import os

name = '/tmp/foo'
f = open(name, 'wb')
f.seek(1 << 32)
f.write(b'asdf')
f.flush()
print(os.fstat(f.fileno()))
f.close()
print(os.stat(name))
"""

Thanks !

----------

_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11277>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to