You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation of AsanProcMaps::GetObjectNameAndOffset that uses dl_iterate_phdr
has been disabled some time ago and is not used on any configuration now.
We need to either fix the bug or remove this code.
The problem is that dl_iterate_phdr_callback assumes that the binaries are sorted by
their addresses, so the first binary that is loaded below the requested address is
taken regardless of whether the requested address falls into that binary:
237 static int dl_iterate_phdr_callback(struct dl_phdr_info *info,
238 size_t size, void *raw_data) {
239 DlIterateData *data = (DlIterateData*)raw_data;
240 int count = data->count++;
241 if (info->dlpi_addr > data->addr)
242 return 0;
243 if (count == 0) {
244 // The first item (the main executable) does not have a so name,
245 // but we can just read it from /proc/self/exe.
246 size_t path_len = readlink("/proc/self/exe",
247 data->filename, data->filename_size - 1);
248 data->filename[path_len] = 0;
249 } else {
250 CHECK(info->dlpi_name);
251 REAL(strncpy)(data->filename, info->dlpi_name, data->filename_size);
252 }
253 data->offset = data->addr - info->dlpi_addr;
254 return 1;
255 }
Reported by ramosian.glider on 2012-05-22 12:06:21
The text was updated successfully, but these errors were encountered:
Originally reported on Google Code with ID 72
Reported by
ramosian.glider
on 2012-05-22 12:06:21The text was updated successfully, but these errors were encountered: