[PATCH] elf: allow anonymous mapping in gap for tst-link-map-contiguous-ldso
Florian Weimer
fweimer@redhat.com
Mon Jan 19 10:43:52 GMT 2026
* Xi Ruoyao:
> On Mon, 2026-01-19 at 11:09 +0100, Florian Weimer wrote:
>> * Xi Ruoyao:
>>
>> > The initialization process of libc.so creates several anonymous mappings
>> > and the kernel may lay them into the gap. If all pages in the gap are
>> > occupied, the test would fail.
>> >
>> > The failure reproduces most frequently on LoongArch because with the
>> > commonly used page size (16 KiB) the gap only contains 4 pages and the
>> > probability they are all occupied is not near to zero. With the changes
>> > in the patch, a test run outputs:
>> >
>> > info: ld.so link map is not contiguous
>> > info: anonymous map found at 0x7ffff1c60000
>> > info: anonymous map found at 0x7ffff1c64000
>> > info: anonymous map found at 0x7ffff1c68000
>> > info: anonymous map found at 0x7ffff1c6c000
>>
>> What's the actual error message from the test?
>
> FAIL: elf/tst-link-map-contiguous-ldso
> original exit status 1
> info: ld.so link map is not contiguous
> error: tst-link-map-contiguous-ldso.c:77: no ld.so gap found
Thanks, I understand now. This is a clear test bug.
This means that we likely have to /proc/self/maps to maintain coverage
and avoid the test bug. 8-( Unfortuantely, I haven't seen this reproduce
in my testing (not even on Arm with 4K pages), so I'm not sure if I can
work on this effectively.
Thanks,
Florian
More information about the Libc-alpha
mailing list