From owner-svn-src-all@freebsd.org Fri Oct 27 07:53:39 2017 Return-Path: Delivered-To: svn-src-all@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 C1CFFE3A22D; Fri, 27 Oct 2017 07:53:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (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 48A417FD8D; Fri, 27 Oct 2017 07:53:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::61b5:f744:558d:eba6] (unknown [IPv6:2001:470:7a58:0:61b5:f744:558d:eba6]) (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 08F54F955; Fri, 27 Oct 2017 09:53:24 +0200 (CEST) From: Dimitry Andric Message-Id: <6FD27DFB-5039-4E33-B131-EF5391DD1630@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_FE439175-2139-41D4-B599-5BD0953053AC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324938 - head/contrib/jemalloc/include/jemalloc/internal Date: Fri, 27 Oct 2017 09:53:24 +0200 In-Reply-To: <38db6f4e-72b8-6ffd-4529-f15ca32bad54@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: mmel@freebsd.org References: <201710232131.v9NLV4Rb068825@repo.freebsd.org> <38db6f4e-72b8-6ffd-4529-f15ca32bad54@freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2017 07:53:39 -0000 --Apple-Mail=_FE439175-2139-41D4-B599-5BD0953053AC Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 27 Oct 2017, at 08:33, Michal Meloun wrote: > > On 23.10.2017 23:31, Dimitry Andric wrote: >> 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 >> > This causes a regression on armv7 for /rescue/sh. At least malloc_slow > is != 0, but I don't known what's exactly happen. Any idea? > > ------------------------------------------------------------------- > /usr/local/bin/gdb801 --args /usr/obj/usr/src/rescue/rescue/rescue sh > GNU gdb (GDB) 8.0.1 [GDB v8.0.1 for FreeBSD] > Reading symbols from /usr/obj/usr/src/rescue/rescue/rescue...done. > (gdb) r > Starting program: /usr/obj/usr/src/rescue/rescue/rescue sh > : > /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:241: Failed > assertion: "!malloc_slow && tsd_tcache_enabled_get(tsd) && > tsd_reentrancy_level_get(tsd) == 0" > > Program received signal SIGABRT, Aborted. > thr_kill () at thr_kill.S:3 > 3 RSYSCALL(thr_kill) > (gdb) bt > #0 thr_kill () at thr_kill.S:3 > #1 0x00823ac8 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52 > #2 0x00823a4c in abort () at /usr/src/lib/libc/stdlib/abort.c:65 > #3 0x007c49cc in tsd_assert_fast (tsd=0x20c82010) at > /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:240 > #4 0x007c3e3c in tsd_fast (tsd=0x20c82010) at > /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:248 > #5 0x007c4c40 in tsd_fetch_impl (init=true, minimal=false) at > /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:266 > #6 0x007c47e0 in tsd_fetch () at > /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:290 > #7 0x007c4774 in __je_malloc_tsd_boot0 () at jemalloc_tsd.c:256 > #8 0x00821370 in malloc_init_hard () at jemalloc_jemalloc.c:1473 > #9 0x00817d24 in malloc_init () at jemalloc_jemalloc.c:220 > #10 0x00814dbc in imalloc (sopts=0xbfbfec70, dopts=0xbfbfec54) at > jemalloc_jemalloc.c:1931 > #11 0x00814ca8 in __malloc (size=12) at jemalloc_jemalloc.c:1981 > #12 0x0019454c in callback_register (func=0x19b290 , arg=0x0) > at /usr/src/sbin/ifconfig/ifconfig.c:705 > #13 0x0019b274 in vlan_ctor () at /usr/src/sbin/ifconfig/ifvlan.c:227 > #14 0x00008318 in handle_static_init (argc=, > argv=, env=) > at /usr/src/lib/csu/common/ignore_init.c:85 > #15 __start (argc=2, argv=0xbfbfed00, env=0xbfbfed0c, > ps_strings=, obj=0x0, cleanup=) > at /usr/src/lib/csu/arm/crt1.c:108 > #16 0x00008180 in ?? () > Backtrace stopped: previous frame identical to this frame (corrupt stack?) Hmm I don't see how adding some padding at the end of struct tsd_s could cause this. Is it possible to figure out which of the three tested values is wrong? -Dimitry --Apple-Mail=_FE439175-2139-41D4-B599-5BD0953053AC 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 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWfLl9AAKCRCwXqMKLiCW o1wEAJ9zuPZJeBVLwDJQ7PKBovBPaQZN4ACePCMMFz862rOUJCHCFKn/AxKWW2M= =BDxh -----END PGP SIGNATURE----- --Apple-Mail=_FE439175-2139-41D4-B599-5BD0953053AC--