There is this application that was written in '91-93 that works in
situation A and not in situation B. It follows the ruls from "mmap"(*),
but the kernel just doesn't do the obvious thing.
If I address something before my 1k window, in situation A, I'll get a
segfault. If I address something beyond my 1k window in situation B
I'll get a segfault.
If I address something after my 1k window in situation A, I'll access
an innocent other device. Same if I address something before my window
in situation B.
Now in practise, I agree that it is more likely in situation B that
something is actually mapped there.
I'm not sure wether the kernel has been wrong all the time or if
something changed recently. I posted the "workaround" the first time
through, which also works from userspace. I can change my application.
I can modify my libc.
However, I'd rather have "mmap" fixed, as that fixes it for all other
applications too. Not just for mine on my system.
The SGI manpage says:
All implementations interpret an addr value of
zero as granting the system complete freedom in selecting pa, subject to
constraints described below. A non-zero value of addr is taken to be a
suggestion of a process address near which the mapping should be placed.
which hints at a possible non-alignment. It also mentions that
"offset" should be page-aligned, which I disagree with here:
everything has been set up to "do the right thing" when the mapping is
possible with an unaligned offset.
Roger.
(*) Allow mmap to chose the address, to allow mmap the maximum
flexibilty of mapping your object.
-- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 ** *-- BitWizard writes Linux device drivers for any device you may have! --* * There are old pilots, and there are bold pilots. * There are also old, bald pilots. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/