From 27e5898f451f9412e57b8fca97b1932b4ed4565e Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Tue, 7 Oct 2014 17:56:53 +0000 Subject: [PATCH] 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@7388 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/base/physicalsocketserver.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webrtc/base/physicalsocketserver.cc b/webrtc/base/physicalsocketserver.cc index cff5e4dcb5..3b12547e96 100644 --- a/webrtc/base/physicalsocketserver.cc +++ b/webrtc/base/physicalsocketserver.cc @@ -14,6 +14,10 @@ #include +#ifdef MEMORY_SANITIZER +#include +#endif + #if defined(WEBRTC_POSIX) #include #include @@ -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;