Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1745894 - subprocess module fails under mod_wsgi: fork not supported for subinterpreters
Summary: subprocess module fails under mod_wsgi: fork not supported for subinterpreters
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1706238 1745450
TreeView+ depends on / blocked
 
Reported: 2019-08-27 07:32 UTC by Christian Heimes
Modified: 2019-09-02 08:54 UTC (History)
12 users (show)

Fixed In Version: python3-3.8.0~b4-1.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-02 07:56:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Python 34651 0 None None None 2019-08-27 07:32:04 UTC
Python 37951 0 None None None 2019-08-27 07:32:04 UTC
Red Hat Bugzilla 1745450 0 unspecified CLOSED ipa-server-install fails with RuntimeError: fork not supported for subinterpreters 2022-05-16 11:32:56 UTC

Description Christian Heimes 2019-08-27 07:32:04 UTC
Description of problem:
Python 3.8 started to prohibit fork() calls in subinterpreters (see bpo-34651). This also affects subprocess.Popen() calls. Only under some cases subprocess.Popen() uses posix_spawn() instead of fork() + exec(). The new restriction breaks software that executes external commands from a subinterpreter like mod_wsgi applications.

For example FreeIPA server is affected by the regression. It's no longer possible to install FreeIPA on Fedora rawhide.

Version-Release number of selected component (if applicable):
Python 3.8b3

How reproducible:
always

Steps to Reproduce:
1. Execute a subprocess under mod_wsgi (e.g. ipa-server-install)

Actual results:
...
  File "/usr/lib64/python3.8/subprocess.py", line 829, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.8/subprocess.py", line 1608, in _execute_child
    self.pid = _posixsubprocess.fork_exec(
RuntimeError: fork not supported for subinterpreters

Expected results:
No error

Additional info:
https://bugs.python.org/issue37951

Comment 1 Christian Heimes 2019-08-27 08:17:00 UTC
Upstream PR https://github.com/python/cpython/pull/15544

Comment 2 Christian Heimes 2019-08-27 21:59:20 UTC
Fix has landed in upstream's 3.8 branch, https://github.com/python/cpython/commit/03c52f2f63a8abeb4afb75e9da46c7d6c0a8afd5

Please apply the fix to 3.8 package on rawhide.

Comment 3 Miro Hrončok 2019-08-28 04:33:54 UTC
Thanks Christian. I've been trying to say this in https://bugs.python.org/issue34651#msg343364 but nothing happened. Thanks for tackling this down. Any chance the fix will be in 3.8.0b4?

Comment 4 Christian Heimes 2019-08-28 05:33:39 UTC
You are welcome, Miro.

I saw your comment after I started digging into the issue, excellent deduction! :) I assume that the consequences were not fully clear to Victor and Eric. Almost nobody uses subinterpreters -- except for some embedded cases and mod_wsgi.

I forgot that 3.8b4 release is imminent. The fix has landed in 3.8 and 3.8b4 is scheduled to be released yesterday. I dropped Łukasz a mail and informed him that 3.8b4 is unblocked again. You are right, let's wait for 3.8b4.

Comment 5 Miro Hrončok 2019-09-02 07:56:32 UTC
Python was updated to 3.8.0b4. Reopen if it doesn't fix the issue.

Comment 6 Christian Heimes 2019-09-02 08:54:46 UTC
Confirmed, 3.8b4 fixed the problem with subinterpreters for FreeIPA and KDCProxy.

Thanks for getting the new build into rawhide so fast.


Note You need to log in before you can comment on or make changes to this bug.