From owner-freebsd-testing@freebsd.org Sat Oct 10 18:00:23 2015 Return-Path: Delivered-To: freebsd-testing@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 73510A10AFD; Sat, 10 Oct 2015 18:00:23 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-yk0-x233.google.com (mail-yk0-x233.google.com [IPv6:2607:f8b0:4002:c07::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B621DF7; Sat, 10 Oct 2015 18:00:23 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ykec126 with SMTP id c126so68018074yke.2; Sat, 10 Oct 2015 11:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=axLjRT8F3/SKscmdtSt9ZdhdXzBCKxK5qt/XQ+QKLsI=; b=twbTy10I6zqPCaudh+Dj/OpWw2CY9xR+EwzSJhyqj6uUCgtnvqiz1tlwrmy6KGRx2q wJwZzEDB6SgDAWMCi7hDZw9KDIe5h5SxU7j0DYVKrTKScxTbHhspleW6FuaY9hHD4oQP 3A15HmzII5F+6qQs2PEG4tdWRvcI6Cw30x5G7rXCBUtcLxOzfT+7baHffNnNRHSsXZi6 FuxBmfEe9IHb09FpbQ2eX33YtY01TTPbKcY60FSuV9NeFsX3JKV1KGc6QqDOVv0gdBOv 7qk+RsDVM709NpJN0VX3hd2CUfleNL8kDWUJ7s2wksETRNuAiwvmZA4O4dau0xYAX6Bb 61ew== MIME-Version: 1.0 X-Received: by 10.13.200.134 with SMTP id k128mr13994752ywd.172.1444500021814; Sat, 10 Oct 2015 11:00:21 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.37.111.214 with HTTP; Sat, 10 Oct 2015 11:00:21 -0700 (PDT) In-Reply-To: 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> Date: Sat, 10 Oct 2015 11:00:21 -0700 X-Google-Sender-Auth: z9mJ5Tx9W8WaM-1lVAfYc2TEVxU Message-ID: Subject: Re: kyua SIGBUS'ing with clang 3.7.0 (was FreeBSD_HEAD-tests - Build #1540 - Unstable) From: Craig Rodrigues To: Dimitry Andric Cc: freebsd-current , "freebsd-testing@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2015 18:00:23 -0000 On Fri, Oct 9, 2015 at 11:37 AM, Dimitry Andric wrote: > > 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 > > Thank you for analyzing and fixing the problem. You have excellent detective skills and worked hard to fix this! -- Craig