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
1 changed files with 13 additions and 0 deletions

View File

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