[PATCH v16 2/8] Add generic 'extra TLS'
Mark Wielaard
mark@klomp.org
Sat Jan 11 17:06:19 GMT 2025
Hi,
On Sat, Jan 11, 2025 at 03:51:53PM +0100, Florian Weimer wrote:
> > -#endif
> > -
> > - init_static_tls (memsz, MAX (TCB_ALIGNMENT, max_align));
> > + init_static_tls (tls_blocks_size, MAX (TCB_ALIGNMENT, max_align));
> > }
>
> This goes wrong on aarch64, resulting in a elf/tst-tlsalign-static
> failure:
>
> tdata1 TLS address 0xaaaac60e9014 % 4 = 0
> tdata2 TLS address 0xaaaac60e9010 % 16 = 0
> tdata3 TLS address 0xaaaac60e9000 % 4096 = 0
> tbss1 TLS address 0xaaaac60ea014 % 4 = 0
> tbss2 TLS address 0xaaaac60ea010 % 16 = 0
> tbss3 TLS address 0xaaaac60ea000 % 4096 = 0
> tbss3 value 24 should be 0
>
> Or crash with segmentation fault because rseq_cs is wrong.
>
> What seems to happen is that the TLS block (including the rseq area)
> overlaps with the start of the sbrk heap. So we are either allocating
> to little memory for the TLS block, or alignment procedure move things
> too far away from the start of the allocation. But I've been staring at
> it for a while, and I just don't see the bug. 8-(
It doesn't really help because there isn't much information in the
buildbot logs. But after the rseq patches went in we are seeing two
new failures on arm64:
FAIL: elf/tst-tlsalign-extern-static
FAIL: elf/tst-tlsalign-static
https://builder.sourceware.org/buildbot/#/builders/265/builds/921
Might of course be coincidence. Sadly the log seems empty they just
say original exit status 139
../scripts/evaluate-test.sh elf/tst-tlsalign-static $? false false > /var/lib/buildbot/worker/glibc-debian-arm64/glibc-build/elf/tst-tlsalign-static.test-result
Segmentation fault
Cheers,
Mark
More information about the Libc-alpha
mailing list