[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

> out of curiosity, did you actually diagnose a process deadlocked due to this 
> or was it noted via code inspection?

The latter. I noted it while working on another issue. While it was easy to 
trigger a malloc() in child_exec() by e.g. specifying an invalid fd in pass_fds 
for Popen, I haven't tried to arrange a deadlock.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
components: +Extension Modules
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset b90c68586e1f2c45c736dd38880f182be267e2ef by Gregory P. Smith 
(Miss Islington (bot)) in branch '3.6':
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) 
(GH-5563)
https://github.com/python/cpython/commit/b90c68586e1f2c45c736dd38880f182be267e2ef


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 2bb0bfafb0beb819b7c60d9004382ce6867847c0 by Gregory P. Smith 
(Miss Islington (bot)) in branch '3.7':
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) 
(GH-5562)
https://github.com/python/cpython/commit/2bb0bfafb0beb819b7c60d9004382ce6867847c0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5385

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5386

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset c1e46e94de38a92f98736af9a42d89c3975a9919 by Gregory P. Smith 
(Alexey Izbyshev) in branch 'master':
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560)
https://github.com/python/cpython/commit/c1e46e94de38a92f98736af9a42d89c3975a9919


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

out of curiosity, did you actually diagnose a process deadlocked due to this or 
was it noted via code inspection?

this issue has been around since 3.4 and the file descriptor inheritance 
changes from the looks of things.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +5382
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev

New submission from Alexey Izbyshev :

_Py_set_inheritable() raises a Python-level exception on error and thus is  not 
async-signal-safe, but child_exec() must use only async-signal-safe functions 
because it's executed between fork() and exec().

Since a non-raising version is already implemented in Python/fileutils.c for 
internal use (set_inheritable), I suggest to simply expose it via another 
public function (similar to _Py_open_noraise(), etc.).

--
components: Library (Lib)
messages: 311699
nosy: izbyshev, vstinner
priority: normal
severity: normal
status: open
title: subprocess: child_exec() uses _Py_set_inheritable() which is not 
async-signal-safe
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com