Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
Well, I think your patch has some issues.
import mmap
m = mmap.mmap(-1, 10)
m.move(10, 10, 0) # legal, should not fail
Traceback (most recent call last):
File stdin, line 1, in module
ValueError: source out of range
m.move(9,
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
Committed in r70800(trunk), r70803(release26-maint), r70808(py3k),
r70811(release30-maint).
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
Jack Diederich jackd...@gmail.com added the comment:
running a fresh 2.7 trunk
a
mmap.mmap object at 0xb7d9f9c0
a.move(-1, -1, -1
... )
Segmentation fault
j...@sprat:~/src/python-rw$ ./python
Python 2.7a0 (trunk:70847M, Mar 31 2009, 14:14:31)
[GCC 4.3.2] on linux2
Type help, copyright,
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
Yes, you are right... My patch was not correct neigher. :-(
Here is revised patch.
--
resolution: fixed -
status: closed - open
Added file: http://bugs.python.org/file13519/fix_mmap_move_v2.patch
Jack Diederich jackd...@gmail.com added the comment:
Looks good. Attached is a more thorough test_mmap.py patch that would
have found the bugs in both our patches ;)
--
resolution: - fixed
status: open - closed
Added file: http://bugs.python.org/file13522/test_mmap_harder.patch
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
I've committed your test with some modification. (r70879) Thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5387
___
Jack Diederich jackd...@gmail.com added the comment:
Here is a more verbose patch. It checks to see if the first two
arguments stand-alone as well. It also updates NEWS and ACKs and adds
some assertRaises for various bounds checks.
--
nosy: +jackdied
Added file:
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
I tried r69943 on coLinux, and I got compile error max is not defined.
Here is updated patch.
--
keywords: +patch
message_count: 1.0 - 2.0
Added file: http://bugs.python.org/file13272/fix_mmap_move.patch
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
mmap.move crashes by integer overflow. See
http://www.nabble.com/Segv-in-mmap.move()-td18617044.html
import mmap
data = mmap.mmap(-1, 1)
data.move(1,1,-1) # crash
Maybe mmap.move should use Py_ssize_t and raise