[issue5282] mmap.resize and offset

Hirokazu Yamamoto report at bugs.python.org
Tue Feb 17 06:35:51 CET 2009


Hirokazu Yamamoto <ocean-city at m2.ccsnet.ne.jp> added the comment:

I investigated more. Following code crashed with bus error on coLinux.

import mmap

def main():
    align = mmap.ALLOCATIONGRANULARITY
    with open("a.txt", "w") as f:
        f.write("0" * align)
        f.write("1" * align)
        f.write("2" * align)
    with open("a.txt", "r+") as f:
        m = mmap.mmap(f.fileno(), align, offset=align*2)
    m.resize(1)
    print m[0] # bus error

if __name__ == '__main__':
    main()

On windows, failed with AccessDenied. (32bit Win2000)

----------
type: behavior -> crash

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


More information about the Python-bugs-list mailing list