summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbos@webrtc.org <pbos@webrtc.org>2014-10-07 17:56:53 +0000
committerpbos@webrtc.org <pbos@webrtc.org>2014-10-07 17:56:53 +0000
commit0c748ef307bf64ef4f5cf1da22283cbc633b1820 (patch)
treefa4b6169041d4fcc99fb0b29ff30917fc84f3e16
parentc556128fcf61e145597d919002e1ee900dfa8ea9 (diff)
downloadwebrtc-0c748ef307bf64ef4f5cf1da22283cbc633b1820.tar.gz
Explicitly unpoison FDs for MSan.
MSan doesn't handle inline assembly that's used by FD_ZERO causing a false positive. R=earthdok@chromium.org, henrike@webrtc.org BUG=chromium:344505 Review URL: https://webrtc-codereview.appspot.com/25799004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@7388 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r--base/physicalsocketserver.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/physicalsocketserver.cc b/base/physicalsocketserver.cc
index cff5e4dc..3b12547e 100644
--- a/base/physicalsocketserver.cc
+++ b/base/physicalsocketserver.cc
@@ -14,6 +14,10 @@
#include <assert.h>
+#ifdef MEMORY_SANITIZER
+#include <sanitizer/msan_interface.h>
+#endif
+
#if defined(WEBRTC_POSIX)
#include <string.h>
#include <errno.h>
@@ -1311,6 +1315,13 @@ bool PhysicalSocketServer::Wait(int cmsWait, bool process_io) {
FD_ZERO(&fdsRead);
fd_set fdsWrite;
FD_ZERO(&fdsWrite);
+ // Explicitly unpoison these FDs on MemorySanitizer which doesn't handle the
+ // inline assembly in FD_ZERO.
+ // http://crbug.com/344505
+#ifdef MEMORY_SANITIZER
+ __msan_unpoison(&fdsRead, sizeof(fdsRead));
+ __msan_unpoison(&fdsWrite, sizeof(fdsWrite));
+#endif
fWait_ = true;