From owner-freebsd-bugs@freebsd.org Wed Aug 16 17:47:02 2017 Return-Path: Delivered-To: freebsd-bugs@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 C62ECDC3DAF for ; Wed, 16 Aug 2017 17:47:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 B403A6836F for ; Wed, 16 Aug 2017 17:47:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v7GHl2br079416 for ; Wed, 16 Aug 2017 17:47:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 221337] -fsanitize=address (asan) fails on i386 Date: Wed, 16 Aug 2017 17:47:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2017 17:47:02 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221337 --- Comment #7 from Dimitry Andric --- (In reply to Konstantin Belousov from comment #6) > (In reply to Dimitry Andric from comment #5) > Still the question is up. Why this code wants 8-byte alignment of the TLS > segment for module with index 1 ? >=20 > What would not work otherwise ? Ah sorry, that is the way upstream compiler-rt has apparently hardcoded it, e.g. they use a define SHADOW_GRANULARITY for this, here: https://github.com/llvm-mirror/compiler-rt/blob/master/lib/asan/asan_mappin= g.h#L193 127 static const u64 kDefaultShadowScale =3D 3; ... 145 #define SHADOW_SCALE kDefaultShadowScale ... 193 #define SHADOW_GRANULARITY (1ULL << SHADOW_SCALE) The same granularity scale values is found in the llvm instrumentation libraries, here: https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/Instrumentat= ion/AddressSanitizer.cpp#L70 70 static const uint64_t kDefaultShadowScale =3D 3; In the past I have attempted to lower this scale to 2, but ran into hundred= s of test failures, so I abandoned that effort. I think the assumption is worki= ng without issue for e.g. Linux, since they left the SysV ABI a long time ago there. And apparently we have been lucky somehow, all this time; it has wo= rked well since the first time we tried AddressSanitizer, up to 12.0 before jema= lloc 5.0.0. --=20 You are receiving this mail because: You are the assignee for the bug.=