[llvm-dev] [cfe-dev] Buildling with/without AddressSanitizer causes divergent execution behaviour

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Fri Feb 12 09:13:37 PST 2016


On Fri, Feb 12, 2016 at 7:53 AM, Dan Liew <dan at su-root.co.uk> wrote:
>
> > This is because your STL was not compiled with MSan. The std::ofstream
> > constructor is provided by libstdc++, the writes are not instrumented,
> and
> > MSan never sees the initialization. Unfortunately, MSan is not very
> useful
> > unless you recompile your *entire* application minus glibc with msan. =/
> >
> > It is possible to build an MSan-ified libc++ and use it if you want to
> keep
> > trying, but it's involved.
>
> Thanks for pointing out. Out of interest how is MSan able to work with
> a non MSan-ified glibc?
>

By intercepting almost the entire libc interface and annotating inputs and
outputs:
https://github.com/llvm-mirror/compiler-rt/blob/master/lib/sanitizer_common/sanitizer_common_interceptors.inc
It's a C ABI boundary, so this is hard but feasible. Interposing all of
libstdc++ is less feasible.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160212/cc59b051/attachment.html>


More information about the llvm-dev mailing list