Message145334
> 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. |
|
Date |
User |
Action |
Args |
2011-10-11 07:45:58 | neologix | set | recipients:
+ neologix, pitrou, jazzer |
2011-10-11 07:45:58 | neologix | set | messageid: <1318319158.35.0.502546091625.issue13148@psf.upfronthosting.co.za> |
2011-10-11 07:45:57 | neologix | link | issue13148 messages |
2011-10-11 07:45:57 | neologix | create | |
|