Peter Hawkins 051542c14d Switch tensorflow::Subprocess to use posix_spawnp() instead of fork()/execvp() on non-Android POSIX platforms.
The goal of this change is to avoid calling pthread_atfork() handlers. Some libraries, in particular the version of OpenBLAS included in NumPy, have buggy pthread_atfork() handlers. See https://github.com/xianyi/OpenBLAS/pull/3111 and https://github.com/google/jax/issues/5713 for details.

Now, while we can and have fixed the buggy atfork handlers, it will take some time for the fix to be deployed in a NumPy release and for users to update to a new NumPy release. So we also take an additional step: avoid running atfork handlers in Subprocess.

My copy of the glibc documentation says:
"
According  to  POSIX, it unspecified whether fork handlers established with pthread_atfork(3)
are called when posix_spawn() is invoked.  On glibc, fork handlers are  called  only  if  the
child is created using fork(2).
"
It appears glibc 2.24 and newer do not call pthread_atfork() handlers from posix_spawn().

Using posix_spawn() should be at least no worse than an explicit fork()/execvp() pair, and on glibc it should do the right thing.

PiperOrigin-RevId: 358317859
Change-Id: Ic1d95446706efa7c0db4e79bf8281f14b2bd99df
2021-02-18 19:36:11 -08:00
..
2021-02-05 03:00:37 +00:00
2021-01-24 10:14:55 -06:00
2021-02-09 00:42:16 +00:00
2020-01-28 22:26:26 -08:00
2020-01-14 15:01:48 -08:00
2020-07-09 13:59:47 -07:00
2018-08-21 16:22:05 -07:00
2020-10-29 02:52:55 +03:00
2020-01-22 15:58:40 -08:00
2020-04-24 20:55:23 -07:00
2020-10-07 08:58:36 -07:00
2021-02-05 16:16:25 -08:00
2019-02-15 09:08:13 -08:00
2019-09-03 11:09:32 -07:00
2020-11-25 10:51:41 -08:00

TensorFlow Base libraries.

This package contains the following libraries: - Platform dependent libraries that require different implementations across different OSs or environments. - STL replacement libraries rest of TensorFlow should depend on.

The libraries in this package are not allowed to have ANY dependencies to any TensorFlow code outside this package.