[asan] Fix ASan preload issue. 39/130739/27
authorDenis Khalikov <d.khalikov@partner.samsung.com>
Thu, 8 Jun 2017 08:32:02 +0000 (11:32 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Tue, 13 Jun 2017 07:10:41 +0000 (07:10 +0000)
commit10747d7c26bb7c0c4e2e8761256e44b82e63f47a
tree2e6fe30b7ce9b80ef18050679ca4e4cdc0b13296
parent01e95341203049e57915f5ad9d8102c909364473
[asan] Fix ASan preload issue.

There might be a situation when ASan initializing later
than shared library which has malloc in static constructor.
(rtld doesn't provide the order of initiazation)
In this case ASan doesn't initialize interceptors but already
intercepting malloc. If malloc is too big to be handled by static
local pool ASan will die with error:

Sanitizer CHECK failed: libsanitizer/asan/asan_malloc_linux.cc:40
((allocated_for_dlsym)) < ((kDlsymAllocPoolSize)) (1036, 1024)

Backported from LLVM mainline rL305058

Change-Id: I93c9662953629b373506fcacacee43edd791c68f
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
libsanitizer/asan/asan_malloc_linux.cc