[PATCH] D64559: [Sanitizers] Fix SanitizerCommon-Unit :: ./Sanitizer-*-Test/MemoryMappingLayout.DumpListOfModules on Solaris
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 05:15:22 PDT 2019
ro created this revision.
ro added a reviewer: kcc.
ro added a project: Sanitizers.
Herald added subscribers: Sanitizers, fedor.sergeev, kubamracek.
Herald added a project: LLVM.
The `MemoryMappingLayout.DumpListOfModules` currently FAILs on Solaris:
[ RUN ] MemoryMappingLayout.DumpListOfModules
/vol/llvm/src/compiler-rt/local/lib/sanitizer_common/tests/sanitizer_procmaps_test.cc:52: Failure
Value of: found
Actual: false
Expected: true
[ FAILED ] MemoryMappingLayout.DumpListOfModules (22 ms)
The problem is that the test expects the executable name from `modules[i].full_name()`,
however the `pr_mapname` field of `struct prmap` is just the entry in `/proc/<pid>/object`,
which is "a.out" instead of "Sanitizer-i386-Test ". Fortunately, the real name can
be determined by looking in `proc/<pid>/path` where "a.out" is a symlink to the
real path.
Tested on `x86_64-pc-solaris2.11`. Ok for trunk?
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D64559
Files:
lib/sanitizer_common/sanitizer_procmaps_solaris.cc
Index: lib/sanitizer_common/sanitizer_procmaps_solaris.cc
===================================================================
--- lib/sanitizer_common/sanitizer_procmaps_solaris.cc
+++ lib/sanitizer_common/sanitizer_procmaps_solaris.cc
@@ -50,9 +50,11 @@
segment->protection |= kProtectionExecute;
if (segment->filename != NULL && segment->filename_size > 0) {
- internal_snprintf(segment->filename,
- Min(segment->filename_size, (uptr)PATH_MAX), "%s",
+ char proc_path[PATH_MAX + 1];
+
+ internal_snprintf(proc_path, sizeof(proc_path), "/proc/self/path/%s",
xmapentry->pr_mapname);
+ internal_readlink(proc_path, segment->filename, segment->filename_size);
}
data_.current += sizeof(prxmap_t);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64559.209180.patch
Type: text/x-patch
Size: 769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190711/67f95f31/attachment.bin>
More information about the llvm-commits
mailing list