Bug 31553 - elf/tst-decorate-maps fails on ppc64el
Summary: elf/tst-decorate-maps fails on ppc64el
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: malloc (show other bugs)
Version: 2.39
: P2 minor
Target Milestone: 2.40
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-25 13:19 UTC by Simon Chopin
Modified: 2024-04-22 18:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Chopin 2024-03-25 13:19:39 UTC
Using the Ubuntu kernels (e.g. 6.5.0-26-generic from Mantic, but also the ones in the upcoming Noble), the glibc test suite fails on

FAIL: elf/tst-decorate-maps
original exit status 1
error: tst-decorate-maps.c:152: not true: r.n_loader_malloc_mmap >= 1
error: tst-decorate-maps.c:167: not true: r.n_loader_malloc_mmap >= 1
error: tst-decorate-maps.c:152: not true: r.n_loader_malloc_mmap >= 1
error: tst-decorate-maps.c:167: not true: r.n_loader_malloc_mmap >= 1
error: 4 test failures

Tested on upstream master branch (as of dc1a77269c "htl: Implement some support for TLS_DTV_AT_TP"), release/2.39/master, as well as the Ubuntu package.

I couldn't see anything particularly relevant in the system logs.

(assigning to malloc component since this seems to be primarily about allocations)
Comment 1 Andreas Schwab 2024-03-25 13:27:43 UTC
Does the kernel use 64k pages?
Comment 2 Simon Chopin 2024-03-25 14:02:09 UTC
(In reply to Andreas Schwab from comment #1)
> Does the kernel use 64k pages?

$ getconf PAGESIZE
65536

I guess it does.
Comment 3 Simon Chopin 2024-03-25 18:17:49 UTC
Thanks Andreas for pointing me to the page size.

There's an assumption made in the test that the early allocation code will need to grow beyond the initial data page, as those extra pages would be the ones marked "[anon: glibc: loader malloc]". However, if the page size is large enough, I guess that assumption isn't valid anymore.

I'll write a patch skipping this particular assertion if the page size is 64k or above.
Comment 4 Adhemerval Zanella 2024-03-26 13:39:13 UTC
(In reply to Simon Chopin from comment #3)
> Thanks Andreas for pointing me to the page size.
> 
> There's an assumption made in the test that the early allocation code will
> need to grow beyond the initial data page, as those extra pages would be the
> ones marked "[anon: glibc: loader malloc]". However, if the page size is
> large enough, I guess that assumption isn't valid anymore.
> 
> I'll write a patch skipping this particular assertion if the page size is
> 64k or above.

I could reproduce it on a ppc64le VM, and it seems to what you described: the __minimal_malloc never issues the mmap because the initial data segment can supply the loader memory requirement.  I think without a way to trigger the load mmap allocation, it would be better to just remove the 'loader malloc' check (it might be that we will need to adjust for possible different page sizes).
Comment 5 Adhemerval Zanella 2024-04-22 18:40:58 UTC
Fixed on 2.40.