This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients jazzer, neologix, pitrou
Date 2011-10-11.07:45:57
SpamBayes Score 2.1146973e-12
Marked as misclassified No
Message-id <1318319158.35.0.502546091625.issue13148@psf.upfronthosting.co.za>
In-reply-to
Content
> The condition contradicts the exception text:

Why?
The offset is zero-based, so 0 <= offset < size is a valid check.

> First of all, it doesn't fail (at least on Linux), I tested it before 
> posting.

Hmmm.
You got lucky, since the offset must be a multiple of the page size.

> tried on newer Linux - crashes with my patch.

That's exactly why we perform such checks. Here's what POSIX says:
"""
[EINVAL]
The addr argument (if MAP_FIXED was specified) or off is not a multiple of the page size as returned by sysconf(), or are considered invalid by the implementation.
[ENXIO]
Addresses in the range [off, off + len) are invalid for the object specified by fildes.
"""

Since we usually want to avoid implementation-defined behavior (and crashes), I think it's better to stick with the current checks (note that issue #12556 concerned a really corner case: /proc entries supporting mmap but reporting a zero-length).

> Therefore, I'm no longer pushing for this change, I will need another 
> workaround anyway.

Alright, closing then.
History
Date User Action Args
2011-10-11 07:45:58neologixsetrecipients: + neologix, pitrou, jazzer
2011-10-11 07:45:58neologixsetmessageid: <1318319158.35.0.502546091625.issue13148@psf.upfronthosting.co.za>
2011-10-11 07:45:57neologixlinkissue13148 messages
2011-10-11 07:45:57neologixcreate