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;