[issue19337] MMAP: Bus error (core dump) under heavy read/write

Charles-François Natali report at bugs.python.org
Mon Oct 21 20:33:57 CEST 2013


Charles-François Natali added the comment:

> 3- From another process, like bash, continuously write to the file.

That's the problem: reducing (actually truncating in your case) a file currently mmaped *can only result in a core dump*: when you try to read from a location in memory which doesn't correspond anymore to a position in the file (since it got truncated), which value could the kernel return?

The page you're trying to read from isn't mapped anymore, so you get a segfault.

Apparently it's even documented in the main page:
"""
The effect of changing the size of the underlying file of a mapping on the pages that correspond to added or removed regions of
       the file is unspecified.
"""

----------
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19337>
_______________________________________


More information about the Python-bugs-list mailing list