Skip to content

Commit a62d376

Browse files
committed
_posixsubprocess: disable vfork when running with ASAN
1 parent 7507a77 commit a62d376

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Modules/_posixsubprocess.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@
4141
#endif
4242

4343
#if defined(__linux__) && defined(HAVE_VFORK) && defined(HAVE_SIGNAL_H) && \
44-
defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
45-
/* If this is ever expanded to non-Linux platforms, verify what calls are
44+
defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK) && \
45+
!defined(_Py_ADDRESS_SANITIZER)
46+
/* Older versions of ASAN do not support vfork(). For example, GCC 9.4.0
47+
* will generate false positives with vfork() and ASAN.
48+
* If this is ever expanded to non-Linux platforms, verify what calls are
4649
* allowed after vfork(). Ex: setsid() may be disallowed on macOS? */
4750
# include <signal.h>
4851
# define VFORK_USABLE 1

0 commit comments

Comments
 (0)