-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect QEMU linux-user emulation in subprocess._use_posix_spawn()
#131398
Comments
subprocess._use_posix_spawn()
How is it an issue to use vfork() if it's emulated with fork()? Is it a performance issue? Do you have examples of benchmark showing the performance problem? |
Without a true vfork, the posix_spawn implementation in glibc cannot See https://lists.gnu.org/archive/html/qemu-devel/2025-03/msg04706.html |
cc @gpshead |
Do you have an example to reproduce the issue? |
It causes a failure while building the MozillaFirefox package: 4:55.15 Traceback (most recent call last): The issue here is that posix_spawn should have set errno to ENOENT. Also, the python testsuite tests this in test_subprocess.py. |
For exmaple: FAIL: test_exception_bad_args_0 (test.test_subprocess.POSIXProcessTestCase.test_exception_bad_args_0)
|
FWIW I agreee with the approach of detecting this unusual/incomplete environment and having _use_posix_spawn() return False there. |
The qemu linux-user emulation does not support CLONE_VFORK and emulates it
with a true fork. That breaks posix_spawn because it cannot report errors
back to the parent process. The subprocess modules should detect that is
it being executed in qemu linux-user emulation and return False in
_use_posix_spawn. One way to do that is to look for "uarch *: qemu" in
/proc/cpuinfo.
The text was updated successfully, but these errors were encountered: