[PATCH] D33784: Bug 33206 - Sanitizer CHECK failed: ((allocated_for_dlsym)) < ((kDlsymAllocPoolSize)) (1036, 1024)) with preload
Denis Khalikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 6 04:15:16 PDT 2017
denis13 added inline comments.
================
Comment at: lib/asan/asan_malloc_linux.cc:88
+ void *new_ptr = LIKELY(asan_inited) ? asan_malloc(size, &stack)
+ : AllocateFromLocalPool(size);
internal_memcpy(new_ptr, ptr, copy_size);
----------------
m.ostapenko wrote:
> eugenis wrote:
> > This is fixing another, unrelated bug - right? In the case of realloc() from the dlsym pool to the regular allocator we may read past the end of the pool.
> >
> > Also, this does not fix the original problem - all reallocs are served from the pool until asan is initialized. Realloc should force asan initialization the same as other interceptors.
> >
> > This is fixing another, unrelated bug - right? In the case of realloc() from the dlsym pool to the regular allocator we may read past the end of the pool.
>
> Right. Besides that, current code looks scruffy so why not refactor?
>
> > Also, this does not fix the original problem - all reallocs are served from the pool until asan is initialized. Realloc should force asan initialization the same as other interceptors.
>
> Yeah, at least realloc(NULL, ...) behaves like malloc and needs to be handled accordingly.
> Also, this does not fix the original problem - all reallocs are served from the pool until asan is initialized. Realloc should force asan initialization the same as other interceptors.
>
Thanks, I got this point. In case first allocation was from local pool by malloc => all reallocs for that address will consume from local pool.
https://reviews.llvm.org/D33784
More information about the llvm-commits
mailing list