From owner-svn-src-head@freebsd.org Mon Oct 23 21:31:05 2017 Return-Path: Delivered-To: svn-src-head@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 7EC2EE558F3; Mon, 23 Oct 2017 21:31:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A50EAAA; Mon, 23 Oct 2017 21:31:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9NLV4h3068826; Mon, 23 Oct 2017 21:31:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9NLV4Rb068825; Mon, 23 Oct 2017 21:31:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201710232131.v9NLV4Rb068825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 23 Oct 2017 21:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324938 - head/contrib/jemalloc/include/jemalloc/internal X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/jemalloc/include/jemalloc/internal X-SVN-Commit-Revision: 324938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2017 21:31:05 -0000 Author: dim Date: Mon Oct 23 21:31:04 2017 New Revision: 324938 URL: https://svnweb.freebsd.org/changeset/base/324938 Log: After jemalloc was updated to version 5.0.0 in r319971, i386 executables linked with AddressSanitizer (even those linked on earlier versions of FreeBSD, or with external versions of clang) started failing with errors similar to: ==14688==AddressSanitizer CHECK failed: /usr/src/contrib/compiler-rt/lib/asan/asan_poisoning.cc:36 "((AddrIsAlignedByGranularity(addr))) != (0)" (0x0, 0x0) This is because AddressSanitizer expects all the TLS data in the program to be aligned to at least 8 bytes. Before the jemalloc 5.0.0 update, all the TLS data in the i386 version of libc.so added up to 80 bytes (a multiple of 8), but 5.0.0 made this grow to 2404 bytes (not a multiple of 8). This is due to added caching data in jemalloc's internal struct tsd_s. To fix AddressSanitizer, ensure this struct is aligned to at least 16 bytes, which can be done unconditionally for all architectures. (An earlier version of the fix aligned the struct to 8 bytes, but only for ILP32 architectures. This was deemed unnecessarily complicated.) PR: 221337 X-MFC-With: r319971 Modified: head/contrib/jemalloc/include/jemalloc/internal/tsd.h Modified: head/contrib/jemalloc/include/jemalloc/internal/tsd.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/tsd.h Mon Oct 23 20:50:08 2017 (r324937) +++ head/contrib/jemalloc/include/jemalloc/internal/tsd.h Mon Oct 23 21:31:04 2017 (r324938) @@ -120,7 +120,8 @@ struct tsd_s { t use_a_getter_or_setter_instead_##n; MALLOC_TSD #undef O -}; +/* AddressSanitizer requires TLS data to be aligned to at least 8 bytes. */ +} JEMALLOC_ALIGNED(16); /* * Wrapper around tsd_t that makes it possible to avoid implicit conversion