forked from OSchip/llvm-project
[Sanitizer] Don't die in symbolizer if it can't read /proc/self/exe link
llvm-svn: 179754
This commit is contained in:
parent
06022fc91a
commit
d1efa5ef96
|
@ -148,7 +148,12 @@ static int dl_iterate_phdr_cb(dl_phdr_info *info, size_t size, void *arg) {
|
|||
// First module is the binary itself.
|
||||
uptr module_name_len = internal_readlink(
|
||||
"/proc/self/exe", module_name.data(), module_name.size());
|
||||
CHECK_NE(module_name_len, (uptr)-1);
|
||||
if (module_name_len == (uptr)-1) {
|
||||
// We can't read /proc/self/exe for some reason, assume the name of the
|
||||
// binary is unknown.
|
||||
module_name_len = internal_snprintf(module_name.data(),
|
||||
module_name.size(), "/proc/self/exe");
|
||||
}
|
||||
CHECK_LT(module_name_len, module_name.size());
|
||||
module_name[module_name_len] = '\0';
|
||||
} else if (info->dlpi_name) {
|
||||
|
|
Loading…
Reference in New Issue