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
This commit is contained in:
pbos@webrtc.org 2014-10-07 17:56:53 +00:00
parent 46ffc70878
commit 27e5898f45

View File

@ -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;