[PATCH] Optional support for dynamic Asan runtime

Alexey Samsonov samsonov at google.com
Mon Mar 31 07:24:17 PDT 2014



================
Comment at: lib/asan/asan_linux.cc:93
@@ +92,3 @@
+
+void AsanCheckIncompatibleRT() {
+#if !SANITIZER_ANDROID
----------------
Yury Gribov wrote:
> Alexey Samsonov wrote:
> > Yury Gribov wrote:
> > > Alexey Samsonov wrote:
> > > > Yury Gribov wrote:
> > > > > I think we can do this:
> > > > > * for static rt:
> > > > > ** check if dynamic rt in /proc/maps (and die if it's there)
> > > > > ** set __asan_rt_version
> > > > > * for dynamic rt:
> > > > > ** check __asan_rt_version (and die if it's already initialized by static rt)
> > > > > 
> > > > > But all this looks too complicated compared to current approach (dlsym + preinit allocator).
> > > > I think this would be easier to digest than these preinit-allocator hooks. I'd try to avoid calling functions from system libraries before ASan is initialized, by all means possible. Could you please try if this approach works?
> > > > 
> > > > Does anyone else have other opinions about it?
> > > Sure I'll give it a try.
> > If we call AsanCheckIncompatibleRT later in initialization (after we initialized the interceptors, allocator, etc. and after we set asan_inited=1), will this still work and will it make preinit-allocator hooks unnecessary?
> > If we call AsanCheckIncompatibleRT later in initialization
> 
> We can't do this without sacrificing usability. As I pointed out in one of earlier comments this may cause segfaults long before initialization finishes.
Ah, I see, this is the comment about MaybeInstallSigaction() problems.


http://llvm-reviews.chandlerc.com/D3042



More information about the llvm-commits mailing list