[PATCH] support: Align the repeated blob mappings to SHMLBA
Stian Halseth
stian@itx.no
Tue Nov 3 10:46:53 GMT 2026
Hi Florian,
On Tue, 2026-11-03 at 11:19 +0100, Florian Weimer wrote:
> * Stian Halseth:
>
> > allocate_big reserves the region with an anonymous mapping, which is
> > only page aligned, and then maps the backing file over it with
> > MAP_FIXED | MAP_SHARED. A shared mapping has to be aligned to SHMLBA,
> > which is 16 KiB on sparc64 against an 8 KiB page, so the mapping fails
> > with EINVAL whenever the reservation lands on an odd page.
> > stdlib/test-bz22786 then crashes on the NULL start, and
> > stdlib/tst-strtod-overflow and string/tst-memmove-overflow report
> > UNSUPPORTED.
> >
> > Over-allocate the reservation and align its start, and make the stride
> > a multiple of SHMLBA so that every shared alias is aligned too.
>
> Would it work to use MAP_SHARED instead of MAP_PRIVATE for the PROT_NONE
> reservation if the shared flag is true?
>
Yes, that worked, and was simpler, thanks!
Same four tests pass on sparc64 and x86_64. Sending a v2 with that change.
/Stian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20261103/e6b40986/attachment-0001.sig>
More information about the Libc-alpha
mailing list