initialization problem w/ thread-specific .tbss data on i386

Dimitry Andric dim at FreeBSD.org
Mon May 7 23:56:34 UTC 2018


On 7 May 2018, at 23:27, Phil Shafer <phil at juniper.net> wrote:
> 
> I have a problem reported with libxo-based applications running
> under FreeBSD-11-stable on i386 boxes that I think is related
> to rtld:
> 
> When I breakpoint on main() and dump the contents of my uninitialized
> thread-specific variable, it has not been initialized to zeroes.

Aha, this might very well be the root cause for
https://bugs.freebsd.org/227552, could you please have a look at that?


> I don't see this problem on 64-bit systems, only on i386 ones.
> 
> When I look at the rtld code, it appears to memset the .tbss to
> zero (/usr/src/libexec/rtld-elf/rtld.c:allocate_tls) in the
> non-arch-specific code so the arch shouldn't matter, but something
> is not working right.
> 
> So I'm looking for a helpful clue, such as how to debug rtld to see
> why this isn't being zeroed.

As discussed in PR227552, it seems that the update to clang 6.0 in
stable/11 is the point at which some programs start crashing, so either
it's some bug in clang's TLS handling, or some subtle change in the
resulting executables is now tripping up rtld.  (I've added John and
Kostik on CC, as they know much more about rtld than me.)

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20180508/8407771f/attachment.sig>


More information about the freebsd-arch mailing list