From owner-freebsd-current@freebsd.org Fri Oct 9 18:37:14 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 122079D1687; Fri, 9 Oct 2015 18:37:14 +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 C37F46E8; Fri, 9 Oct 2015 18:37:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::44be:a9b3:6e19:762] (unknown [IPv6:2001:7b8:3a7:0:44be:a9b3:6e19:762]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 083D02A33E; Fri, 9 Oct 2015 20:37:10 +0200 (CEST) Subject: Re: kyua SIGBUS'ing with clang 3.7.0 (was FreeBSD_HEAD-tests - Build #1540 - Unstable) Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7EECD821-E132-4FA2-BBBE-71E173466123"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 From: Dimitry Andric In-Reply-To: Date: Fri, 9 Oct 2015 20:37:09 +0200 Cc: freebsd-current , "freebsd-testing@freebsd.org" Message-Id: References: <64208980.212.1444173234007.JavaMail.jenkins@jenkins-9.freebsd.org> <9AA1E7FE-9C61-4730-B597-CD621960B6AB@gmail.com> <16D1DE3E-32FB-4B47-948F-83CF6BCF09C1@FreeBSD.org> <3F707412-A902-4E6F-8662-C49E1A9B8311@gmail.com> <56152FB3.7000205@freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.3094) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2015 18:37:14 -0000 --Apple-Mail=_7EECD821-E132-4FA2-BBBE-71E173466123 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 09 Oct 2015, at 04:29, Craig Rodrigues wrote: > > On Wed, Oct 7, 2015 at 2:28 PM, Dimitry Andric wrote: >> >> Do you still have a copy of the earlier executable? Can you post it >> somewhere? > I was able to reproduce the problem. ... > #0 0x000000080085dcfd in std::__1::ios_base::Init::Init () > from /usr/lib/libc++.so.1 I have committed a (hopefully temporary) workaround in r289072. If you don't want to do a full buildworld, first rebuild clang and install it, then rebuild libc++ and install it. After some back-and-forth about the cause, I am now reasonably convinced that it is due to a bug in clang 3.7.0, as I noted in the commit message: Some further explanation: libc++'s iostream.cpp contains the definitions of std::cout, std::cerr and so on. These global objects are effectively declared with an alignment of 8 bytes. When an executable is linked against libc++.so, it can sometimes get a copy of the global object, which is then at the same alignment. However, with clang 3.7.0, the initialization of these global objects will incorrectly use SSE instructions (e.g. movdqa), whenever the optimization level is high enough, and SSE is enabled, such as on amd64. When any of these objects is not aligned to 16 bytes, this will result in a SIGBUS during iostream initialization. In contrast, clang 3.6.x and earlier took the 8 byte alignment into consideration, and avoided SSE for those particular operations. After bisecting of upstream changes, I found that the above revision [llvm r240144] caused the change of this behavior, so I am reverting it now as a workaround, while a discussion and test case is being prepared for upstream. -Dimitry --Apple-Mail=_7EECD821-E132-4FA2-BBBE-71E173466123 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.28 iEYEARECAAYFAlYYCVUACgkQsF6jCi4glqP9HQCeOA4dCJHOAHAA40VB0JKfB95H lrcAn3nGQuLWbgYUtbuihC8KuA8qM99g =VjAd -----END PGP SIGNATURE----- --Apple-Mail=_7EECD821-E132-4FA2-BBBE-71E173466123--