From owner-freebsd-arch@freebsd.org Mon May 7 23:56:34 2018 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0105DFC1B30 for ; Mon, 7 May 2018 23:56:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D79A774BD; Mon, 7 May 2018 23:56:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id DFB422255; Tue, 8 May 2018 01:56:31 +0200 (CEST) From: Dimitry Andric Message-Id: <21DD27C1-AA3D-4055-84BF-B4E278DC2BBB@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_F276EF6F-05F2-48EC-9C86-18B365972780"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: initialization problem w/ thread-specific .tbss data on i386 Date: Tue, 8 May 2018 01:56:27 +0200 In-Reply-To: <201805072127.w47LR3W5060281@idle.juniper.net> Cc: freebsd-arch@freebsd.org, John Baldwin , Konstantin Belousov To: Phil Shafer References: <201805072127.w47LR3W5060281@idle.juniper.net> X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2018 23:56:34 -0000 --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 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--