Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Aug 2017 17:47:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 221337] -fsanitize=address (asan) fails on i386
Message-ID:  <bug-221337-8-ZXu4acBs0D@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-221337-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-221337-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221337

--- Comment #7 from Dimitry Andric <dim@FreeBSD.org> ---
(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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-221337-8-ZXu4acBs0D>