Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 May 2018 01:56:27 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Phil Shafer <phil@juniper.net>
Cc:        freebsd-arch@freebsd.org, John Baldwin <jhb@freebsd.org>, Konstantin Belousov <kib@FreeBSD.org>
Subject:   Re: initialization problem w/ thread-specific .tbss data on i386
Message-ID:  <21DD27C1-AA3D-4055-84BF-B4E278DC2BBB@FreeBSD.org>
In-Reply-To: <201805072127.w47LR3W5060281@idle.juniper.net>
References:  <201805072127.w47LR3W5060281@idle.juniper.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_F276EF6F-05F2-48EC-9C86-18B365972780
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On 7 May 2018, at 23:27, Phil Shafer <phil@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


--Apple-Mail=_F276EF6F-05F2-48EC-9C86-18B365972780
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWvDnqwAKCRCwXqMKLiCW
oyCsAKC4FsAfxGpyTOOa2NXbHFWwqdEDMwCg+b9lOADXEBwfBTnmYb0zVwC126g=
=c3y4
-----END PGP SIGNATURE-----

--Apple-Mail=_F276EF6F-05F2-48EC-9C86-18B365972780--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?21DD27C1-AA3D-4055-84BF-B4E278DC2BBB>