[issue12957] mmap.resize changes memory address of mmap'd region

New submission from Michael Schurter <m@schmichael.com>: Since mmap.resize uses MREMAP_MAYMOVE on Linux, it would be nice to warn users that pointers into their memory mapped regions will be invalid after resizes. Linux's manpage offers the following explanation: "If the mapping is relocated, then absolute pointers into the old mapping location become invalid (offsets relative to the starting address of the mapping should be employed)." Since the only way I know of to use pointers into mmaps from pure Python is to use ctypes.<type>.from_buffer(<mmap>), perhaps clarification would be better in the ctypes docs. ---------- assignee: docs@python components: Documentation files: killctypes.py messages: 143845 nosy: docs@python, schmichael priority: normal severity: normal status: open title: mmap.resize changes memory address of mmap'd region type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file23126/killctypes.py _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12957> _______________________________________

Changes by Alex Gaynor <alex.gaynor@gmail.com>: ---------- nosy: +alex _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12957> _______________________________________

Changes by Christian Heimes <lists@cheimes.de>: ---------- stage: -> needs patch versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12957> _______________________________________

Mark Lawrence added the comment: @Michael can you provide a patch to this effect? ---------- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12957> _______________________________________

Change by Mark Lawrence <breamoreboy@gmail.com>: ---------- nosy: -BreamoreBoy _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue12957> _______________________________________

Changes by Alex Gaynor <alex.gaynor@gmail.com>: ---------- nosy: +alex _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12957> _______________________________________

Changes by Christian Heimes <lists@cheimes.de>: ---------- stage: -> needs patch versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12957> _______________________________________

Mark Lawrence added the comment: @Michael can you provide a patch to this effect? ---------- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue12957> _______________________________________

Change by Mark Lawrence <breamoreboy@gmail.com>: ---------- nosy: -BreamoreBoy _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue12957> _______________________________________
participants (4)
-
Alex Gaynor
-
Christian Heimes
-
Mark Lawrence
-
Michael Schurter