-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Open
Labels
OS-unsupportedextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
# cat python-popen-script.py
import subprocess
p = subprocess.Popen(['ls', '-l'])
# trace -a -x "./python python-popen-script.py"
# trcrpt > capture_trcrpt
# head -25 capture_trcrpt
Mon Nov 17 02:43:50 2025
System: AIX 7.2 Node: fvtvios10
Machine: 00F905D14C00
Internet Address: 0972E2D7 9.114.226.215
At trace startup, the system contained 8 cpus, of which 8 were traced.
Buffering: Kernel Heap
This is from a 64-bit kernel.
Tracing all hooks.
trace -a -x ./python python-popen-script.py
ID ELAPSED_SEC DELTA_MSEC APPL SYSCALL KERNEL INTERRUPT
101 0.000000000 0.000000 close LR = 101CB570
104 0.000000345 0.000345 return from close. error EBADF [0 usec]
101 0.000001187 0.000842 close LR = 101CB580
104 0.000001523 0.000336 return from close. error EBADF [0 usec]
101 0.000002361 0.000838 close LR = 101CB570
104 0.000002705 0.000344 return from close. error EBADF [0 usec]
101 0.000003541 0.000836 close LR = 101CB580
104 0.000003884 0.000343 return from close. error EBADF [0 usec]
101 0.000004734 0.000850 close LR = 101CB570
104 0.000005080 0.000346 return from close. error EBADF [0 usec]
101 0.000005919 0.000839 close LR = 101CB580
104 0.000006253 0.000334 return from close. error EBADF [0 usec]
# grep EBADF capture_trcrpt | wc -l
21409
Looks like _posixsubprocess module uses /proc/self/fd which is not available in AIX. Instead /proc/<PID>/fd should be used in AIX.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Other
Linked PRs
- gh-141659: Fix bad file descriptors from subprocess in AIX #141660
- [3.14] gh-141659: Fix bad file descriptor error in subprocess on AIX (GH-141660) #141738
- gh-141659: Move NEWS entry from Core_and_Builtins to Library #141744
- [3.14] Move the NEWS entry for gh-141659 to the correct section (GH-141744) #141766
Metadata
Metadata
Assignees
Labels
OS-unsupportedextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status