diff --git a/Zend/zend_max_execution_timer.c b/Zend/zend_max_execution_timer.c index 6f09d2fa227..2ef59bbdaac 100644 --- a/Zend/zend_max_execution_timer.c +++ b/Zend/zend_max_execution_timer.c @@ -27,6 +27,10 @@ # include # endif +#if __has_feature(memory_sanitizer) +# include +#endif + #include "zend.h" #include "zend_globals.h" @@ -61,6 +65,12 @@ ZEND_API void zend_max_execution_timer_init(void) /* {{{ */ sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid); # endif +#if __has_feature(memory_sanitizer) + /* MSan does not intercept timer_create() */ + __msan_unpoison(&EG(max_execution_timer_timer), + sizeof(EG(max_execution_timer_timer))); +#endif + // Measure wall time instead of CPU time as originally planned now that it is possible https://github.com/php/php-src/pull/6504#issuecomment-1370303727 if (timer_create(ZEND_MAX_EXECUTION_TIMERS_CLOCK, &sev, &EG(max_execution_timer_timer)) != 0) { zend_strerror_noreturn(E_ERROR, errno, "Could not create timer");