[compiler-rt] r183218 - [asan] Fix invalid thread registry access when checking if LSan is disabled.

Sergey Matveev earthdok at google.com
Wed Jun 5 01:46:14 PDT 2013


kDirectlyLeaked is the default value.


On Tue, Jun 4, 2013 at 8:10 PM, Alexander Potapenko <glider at google.com>wrote:

> Should we mark the memory as directly leaked if t is NULL?
>
> On Tue, Jun 4, 2013 at 2:39 PM, Sergey Matveev <earthdok at google.com>
> wrote:
> > Author: smatveev
> > Date: Tue Jun  4 05:39:24 2013
> > New Revision: 183218
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=183218&view=rev
> > Log:
> > [asan] Fix invalid thread registry access when checking if LSan is
> disabled.
> >
> > Modified:
> >     compiler-rt/trunk/lib/asan/asan_allocator2.cc
> >
> > Modified: compiler-rt/trunk/lib/asan/asan_allocator2.cc
> > URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=183218&r1=183217&r2=183218&view=diff
> >
> ==============================================================================
> > --- compiler-rt/trunk/lib/asan/asan_allocator2.cc (original)
> > +++ compiler-rt/trunk/lib/asan/asan_allocator2.cc Tue Jun  4 05:39:24
> 2013
> > @@ -422,8 +422,10 @@ static void *Allocate(uptr size, uptr al
> >      uptr fill_size = Min(size, (uptr)fl.max_malloc_fill_size);
> >      REAL(memset)(res, fl.malloc_fill_byte, fill_size);
> >    }
> > -  m->lsan_tag =
> > -      t->lsan_disabled() ? __lsan::kSuppressed :
> __lsan::kDirectlyLeaked;
> > +  if (t && t->lsan_disabled())
> > +    m->lsan_tag = __lsan::kSuppressed;
> > +  else
> > +    m->lsan_tag = __lsan::kDirectlyLeaked;
> >    // Must be the last mutation of metadata in this function.
> >    atomic_store((atomic_uint8_t *)m, CHUNK_ALLOCATED,
> memory_order_release);
> >    ASAN_MALLOC_HOOK(res, size);
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
> --
> Alexander Potapenko
> Software Engineer
> Google Moscow
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130605/2cb6f913/attachment.html>


More information about the llvm-commits mailing list