[compiler-rt] r251345 - [msan] Fix process_vm_readv test.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 26 13:55:35 PDT 2015
Author: eugenis
Date: Mon Oct 26 15:55:35 2015
New Revision: 251345
URL: http://llvm.org/viewvc/llvm-project?rev=251345&view=rev
Log:
[msan] Fix process_vm_readv test.
The check for the glibc version was not working as expected (dlsym
was finding the interceptor instead of the libc implementation).
Modified:
compiler-rt/trunk/test/msan/Linux/process_vm_readv.cc
Modified: compiler-rt/trunk/test/msan/Linux/process_vm_readv.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/Linux/process_vm_readv.cc?rev=251345&r1=251344&r2=251345&view=diff
==============================================================================
--- compiler-rt/trunk/test/msan/Linux/process_vm_readv.cc (original)
+++ compiler-rt/trunk/test/msan/Linux/process_vm_readv.cc Mon Oct 26 15:55:35 2015
@@ -10,18 +10,15 @@
#include <sys/uio.h>
#include <unistd.h>
-typedef ssize_t (*process_vm_readwritev_fn)(pid_t, const iovec *, unsigned long,
+typedef ssize_t (*process_vm_readv_fn)(pid_t, const iovec *, unsigned long,
const iovec *, unsigned long,
unsigned long);
int main(void) {
// This requires glibc 2.15.
- process_vm_readwritev_fn process_vm_readv =
- (process_vm_readwritev_fn)dlsym(RTLD_DEFAULT, "process_vm_readv");
- process_vm_readwritev_fn process_vm_writev =
- (process_vm_readwritev_fn)dlsym(RTLD_DEFAULT, "process_vm_writev");
- if (!process_vm_readv) {
- assert(!process_vm_writev);
+ process_vm_readv_fn libc_process_vm_readv =
+ (process_vm_readv_fn)dlsym(RTLD_NEXT, "process_vm_readv");
+ if (!libc_process_vm_readv) {
// Exit with success, emulating the expected output.
#ifdef POSITIVE
printf("process_vm_readv not found!\n");
@@ -32,7 +29,6 @@ int main(void) {
return 0;
#endif
}
- assert(process_vm_readv && process_vm_writev);
char a[100];
memset(a, 0xab, 100);
More information about the llvm-commits
mailing list