Message ID | 537F224A.9070107@samsung.com |
---|---|
State | New |
Headers | show |
Hi, On 05/23/2014 12:26 PM, Yury Gribov wrote: > >> Could you add something like > > > > It's always linux-vdso.so.1, but wasn't that already known, given the > > ldd requested by Jakub?!? > > Well, for me dlpi_name for vdso was empty string hence I kept asking. > I also thought that ldd and dl_iterate_phdr might have used slightly > different code paths when quering information from dynamic linker. > > Could you check if the attached patch fixes the problem for you? > Note that I only did limited testing (RUNTESTFLAGS=asan.exp). Thanks. It appears to work great for me modulo a trivial off-by-one (you want sizeof(...) - 1) and the asan_test.C issue already discussed by Jakub. Paolo.
diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc index d893b23..11137d9 100644 --- a/libsanitizer/asan/asan_linux.cc +++ b/libsanitizer/asan/asan_linux.cc @@ -89,6 +89,10 @@ static int FindFirstDSOCallback(struct dl_phdr_info *info, size_t size, if (!info->dlpi_name || info->dlpi_name[0] == 0) return 0; + // Ignore vDSO + if (internal_strncmp(info->dlpi_name, "linux-", sizeof("linux-")) == 0) + return 0; + *(const char **)data = info->dlpi_name; return 1; }