Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 113439 - python-2.4.2 - mmap.move fails on amd64
Summary: python-2.4.2 - mmap.move fails on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Highest normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-24 02:26 UTC by Archie Elberling
Modified: 2006-02-02 13:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
fix to use longs for mmap move calls (python-2.4.2-amd64_mmap.patch,421 bytes, patch)
2005-11-24 02:35 UTC, Archie Elberling
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Archie Elberling 2005-11-24 02:26:21 UTC
the declaration for pythons mmap.move method uses signed ints which result in an
out of range exception on amd64 (and possibly any 64bit platform)

Reproducible: Always
Steps to Reproduce:
from mmap import mmap
f = open('test.out', 'ab+')
f.write('ABCDEabcde')
f.flush()
m = mmap(f.fileno(),10)
m.move(5,0,5)
m.read()
Actual Results:  
after m.move(5,0,5) you get:
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    ValueError: source or destination out of range


Expected Results:  
>>> m.read(10)
'ABCDEABCDE'
Comment 1 Archie Elberling 2005-11-24 02:35:22 UTC
Created attachment 73481 [details, diff]
fix to use longs for mmap move calls

Adjusts mmap move to use longs for defining memmory addresses rather than ints.

tested on:
x86 (Python 2.4.2, GCC 3.4.4-r1)
amd64 (Python 2.4.2 GCC 3.3.6)

(thanks to mu from quodlibet for the fix)
Comment 2 Alastair Tse (RETIRED) gentoo-dev 2005-12-02 02:38:57 UTC
we should push thise patch upstream as well.
Comment 3 Alastair Tse (RETIRED) gentoo-dev 2006-01-16 07:20:26 UTC
spotted change in python svn:

http://svn.python.org/view/python/trunk/Modules/mmapmodule.c?rev=42012&view=auto

instead of "iii" they're using "kkk":

http://docs.python.org/api/arg-parsing.html
Comment 4 Bryan Østergaard (RETIRED) gentoo-dev 2006-02-02 13:19:55 UTC
Fixed in 2.4.2-r1.