<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Modules/_posixsubprocess.c, branch fix-misc-acks</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-35550: Fix incorrect Solaris define guards (GH-11275)</title>
<updated>2018-12-31T02:39:00+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-12-31T02:39:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=d82344378ad8e471b8ed12fb99807f68351c5412'/>
<id>d82344378ad8e471b8ed12fb99807f68351c5412</id>
<content type='text'>
Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used.

Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_systemGH-Solaris

https://bugs.python.org/issue35550
(cherry picked from commit 6f9bc72c79c3262e5d0f2c0e96b016477399cfb1)

Co-authored-by: Jakub Kulík &lt;Kulikjak@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used.

Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_systemGH-Solaris

https://bugs.python.org/issue35550
(cherry picked from commit 6f9bc72c79c3262e5d0f2c0e96b016477399cfb1)

Co-authored-by: Jakub Kulík &lt;Kulikjak@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)</title>
<updated>2018-11-13T06:20:21+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-11-13T06:20:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=f6602f92664b782125a1ec5009706f9300fe7e80'/>
<id>f6602f92664b782125a1ec5009706f9300fe7e80</id>
<content type='text'>
Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER.
Project based C Preprocessor namespacing at its finest. :P
(cherry picked from commit 3015fb8ce4d25603434b9b44bb7effb98a481532)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER.
Project based C Preprocessor namespacing at its finest. :P
(cherry picked from commit 3015fb8ce4d25603434b9b44bb7effb98a481532)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[3.7] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10492)</title>
<updated>2018-11-12T21:48:24+00:00</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2018-11-12T21:48:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=5f4d05d83fde05fed0b6554d0beee4f1c1f1d8f1'/>
<id>5f4d05d83fde05fed0b6554d0beee4f1c1f1d8f1</id>
<content type='text'>
Adds configure flags for msan and ubsan builds to make it easier to enable.
These also encode the detail that address sanitizer and memory sanitizer
should disable pymalloc.

Define MEMORY_SANITIZER when appropriate at build time and adds workarounds
to existing code to mark things as initialized where the sanitizer is otherwise unable to
determine that.  This lets our build succeed under the memory sanitizer.  not all tests
pass without sanitizer failures yet but we're in pretty good shape after this.

(cherry picked from commit 1584a0081500d35dc93ff88e5836df35faf3e3e2)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt; [Google LLC]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds configure flags for msan and ubsan builds to make it easier to enable.
These also encode the detail that address sanitizer and memory sanitizer
should disable pymalloc.

Define MEMORY_SANITIZER when appropriate at build time and adds workarounds
to existing code to mark things as initialized where the sanitizer is otherwise unable to
determine that.  This lets our build succeed under the memory sanitizer.  not all tests
pass without sanitizer failures yet but we're in pretty good shape after this.

(cherry picked from commit 1584a0081500d35dc93ff88e5836df35faf3e3e2)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt; [Google LLC]</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-34658: Fix rare subprocess prexec_fn fork error. (GH-9255)</title>
<updated>2018-09-13T17:11:00+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-09-13T17:11:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=b2ff9a9f9298761985aa85aa3f42421ce6effb9e'/>
<id>b2ff9a9f9298761985aa85aa3f42421ce6effb9e</id>
<content type='text'>
[bpo-34658](https://www.bugs.python.org/issue34658): Fix a rare interpreter unhandled exception state SystemError only
seen when using subprocess with a preexec_fn while an after_parent handler has
been registered with os.register_at_fork and the fork system call fails.

https://bugs.python.org/issue34658
(cherry picked from commit a20b6adb5a5880fd22c099961eb9f9787739cefe)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[bpo-34658](https://www.bugs.python.org/issue34658): Fix a rare interpreter unhandled exception state SystemError only
seen when using subprocess with a preexec_fn while an after_parent handler has
been registered with os.register_at_fork and the fork system call fails.

https://bugs.python.org/issue34658
(cherry picked from commit a20b6adb5a5880fd22c099961eb9f9787739cefe)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242) (GH-9148)</title>
<updated>2018-09-11T04:36:20+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-09-11T04:36:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=9c4a63fc17efea31ad41f90d28825be37469e0e2'/>
<id>9c4a63fc17efea31ad41f90d28825be37469e0e2</id>
<content type='text'>
When subprocess.Popen() stdin= stdout= or stderr= handles are specified
and appear in pass_fds=, don't close the original fds after dup'ing them.

This implementation and unittest primarily came from @izbyshev (see the PR)

See also https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c

This also removes the old manual p2cread, c2pwrite, and errwrite closing logic
as inheritable flags and _close_open_fds takes care of that properly today without special treatment.

This code is within child_exec() where it is the only thread so there is no
race condition between the dup and _Py_set_inheritable_async_safe call.
(cherry picked from commit ce34410b8b67f49d8275c05d51b3ead50cf97f48)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt; [Google]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When subprocess.Popen() stdin= stdout= or stderr= handles are specified
and appear in pass_fds=, don't close the original fds after dup'ing them.

This implementation and unittest primarily came from @izbyshev (see the PR)

See also https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c

This also removes the old manual p2cread, c2pwrite, and errwrite closing logic
as inheritable flags and _close_open_fds takes care of that properly today without special treatment.

This code is within child_exec() where it is the only thread so there is no
race condition between the dup and _Py_set_inheritable_async_safe call.
(cherry picked from commit ce34410b8b67f49d8275c05d51b3ead50cf97f48)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt; [Google]</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)</title>
<updated>2018-03-26T20:14:09+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-03-26T20:14:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=05455637f3ba9bacd459700f4feab783e5967d69'/>
<id>05455637f3ba9bacd459700f4feab783e5967d69</id>
<content type='text'>
bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr.

When redirecting, subprocess attempts to achieve the following state:
each fd to be redirected to is less than or equal to the fd
it is redirected from, which is necessary because redirection
occurs in the ascending order of destination descriptors.
It fails to do so in a couple of corner cases,
for example, if 1 is redirected to 2 and 0 is closed in the parent.
(cherry picked from commit 0e7144b064a19493a146af94175a087b3888c37b)

Co-authored-by: Alexey Izbyshev &lt;izbyshev@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr.

When redirecting, subprocess attempts to achieve the following state:
each fd to be redirected to is less than or equal to the fd
it is redirected from, which is necessary because redirection
occurs in the ascending order of destination descriptors.
It fails to do so in a couple of corner cases,
for example, if 1 is redirected to 2 and 0 is closed in the parent.
(cherry picked from commit 0e7144b064a19493a146af94175a087b3888c37b)

Co-authored-by: Alexey Izbyshev &lt;izbyshev@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) (GH-5562)</title>
<updated>2018-02-06T06:31:22+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-02-06T06:31:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=2bb0bfafb0beb819b7c60d9004382ce6867847c0'/>
<id>2bb0bfafb0beb819b7c60d9004382ce6867847c0</id>
<content type='text'>
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process.  This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.

This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions).  `ioctl` is not a POSIX async-signal-safe approved function.

ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919)

Co-authored-by: Alexey Izbyshev &lt;izbyshev@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process.  This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.

This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions).  `ioctl` is not a POSIX async-signal-safe approved function.

ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919)

Co-authored-by: Alexey Izbyshev &lt;izbyshev@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Fix miscellaneous typos (#4275)</title>
<updated>2017-11-05T13:37:50+00:00</updated>
<author>
<name>luzpaz</name>
<email>luzpaz@users.noreply.github.com</email>
</author>
<published>2017-11-05T13:37:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=a5293b4ff2c1b5446947b4986f98ecf5d52432d4'/>
<id>a5293b4ff2c1b5446947b4986f98ecf5d52432d4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-16500: Don't use string constants for os.register_at_fork() behavior (#1834)</title>
<updated>2017-05-29T17:03:41+00:00</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2017-05-29T17:03:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=163468a766e16604bdea04a1ab808c0d3e729e5d'/>
<id>163468a766e16604bdea04a1ab808c0d3e729e5d</id>
<content type='text'>
Instead use keyword only arguments to os.register_at_fork for each of the scenarios.
Updates the documentation for clarity.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead use keyword only arguments to os.register_at_fork for each of the scenarios.
Updates the documentation for clarity.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-16500: Allow registering at-fork handlers (#1715)</title>
<updated>2017-05-27T15:50:54+00:00</updated>
<author>
<name>Antoine Pitrou</name>
<email>pitrou@free.fr</email>
</author>
<published>2017-05-27T15:50:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=346cbd351ee0dd3ab9cb9f0e4cb625556707877e'/>
<id>346cbd351ee0dd3ab9cb9f0e4cb625556707877e</id>
<content type='text'>
* bpo-16500: Allow registering at-fork handlers

* Address Serhiy's comments

* Add doc for new C API

* Add doc for new Python-facing function

* Add NEWS entry + doc nit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* bpo-16500: Allow registering at-fork handlers

* Address Serhiy's comments

* Add doc for new C API

* Add doc for new Python-facing function

* Add NEWS entry + doc nit
</pre>
</div>
</content>
</entry>
</feed>
