@@ -367,6 +367,10 @@ static int win32_can_symlink = 0;
367
367
#define HAVE_STRUCT_STAT_ST_FSTYPE 1
368
368
#endif
369
369
370
+ #ifdef _Py_MEMORY_SANITIZER
371
+ # include <sanitizer/msan_interface.h>
372
+ #endif
373
+
370
374
#ifdef HAVE_FORK
371
375
static void
372
376
run_at_forkers (PyObject * lst , int reverse )
@@ -5493,6 +5497,9 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
5493
5497
PyErr_SetFromErrnoWithFilenameObject (PyExc_OSError , path -> object );
5494
5498
goto exit ;
5495
5499
}
5500
+ #ifdef _Py_MEMORY_SANITIZER
5501
+ __msan_unpoison (& pid , sizeof (pid ));
5502
+ #endif
5496
5503
result = PyLong_FromPid (pid );
5497
5504
5498
5505
exit :
@@ -6098,6 +6105,9 @@ os_sched_rr_get_interval_impl(PyObject *module, pid_t pid)
6098
6105
posix_error ();
6099
6106
return -1.0 ;
6100
6107
}
6108
+ #ifdef _Py_MEMORY_SANITIZER
6109
+ __msan_unpoison (& interval , sizeof (interval ));
6110
+ #endif
6101
6111
return (double )interval .tv_sec + 1e-9 * interval .tv_nsec ;
6102
6112
}
6103
6113
#endif /* HAVE_SCHED_RR_GET_INTERVAL */
@@ -6568,6 +6578,12 @@ posix_getgrouplist(PyObject *self, PyObject *args)
6568
6578
return posix_error ();
6569
6579
}
6570
6580
6581
+ #ifdef _Py_MEMORY_SANITIZER
6582
+ /* Clang memory sanitizer libc intercepts don't know getgrouplist. */
6583
+ __msan_unpoison (& ngroups , sizeof (ngroups ));
6584
+ __msan_unpoison (groups , ngroups * sizeof (* groups ));
6585
+ #endif
6586
+
6571
6587
list = PyList_New (ngroups );
6572
6588
if (list == NULL ) {
6573
6589
PyMem_Del (groups );
0 commit comments