Memory sanitizer workaround: unpoison fd_sets.

This is necessary with clang-9, maybe earlier.
This commit is contained in:
Emil Mikulic 2020-07-01 19:18:13 +10:00
parent e2e693e1cf
commit 27e489aab7

View File

@ -70,6 +70,12 @@ static const int debug = 1;
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#if defined(__has_feature)
# if __has_feature(memory_sanitizer)
# include <sanitizer/msan_interface.h>
# endif
#endif
#ifdef __sun__ #ifdef __sun__
# ifndef INADDR_NONE # ifndef INADDR_NONE
# define INADDR_NONE -1 # define INADDR_NONE -1
@ -2372,6 +2378,13 @@ static void httpd_poll(void) {
} }
#undef MAX_FD_SET #undef MAX_FD_SET
#if defined(__has_feature)
# if __has_feature(memory_sanitizer)
__msan_unpoison(&recv_set, sizeof(recv_set));
__msan_unpoison(&send_set, sizeof(send_set));
# endif
#endif
/* -select- */ /* -select- */
if (debug) { if (debug) {
printf("select() with max_fd %d timeout %d\n", printf("select() with max_fd %d timeout %d\n",