[New-bugs-announce] [issue43081] Recursive call crash module multiprocessing

Xinmeng Xia report at bugs.python.org
Sun Jan 31 00:26:56 EST 2021


New submission from Xinmeng Xia <xiaxm at smail.nju.edu.cn>:

The following code recursively calls function test_forkserver(). However, the output is not expected RecursionError(recursively calling) or OSError(too many open files). An unexpected EOFError ( inside module multiprocessing, not this code itself) is reported. According to the error message, Python interpreter seems to behavior abnormal on line 1, "import multiprocessing". I try other cases in my machine, multiprocessing module can work well. Only this case will crash module multiprocessing.

test.py
======================================
import multiprocessing
import os

def do(i):
      print(test_forkserver(), os.getpid())

def test_forkserver():
      mp = multiprocessing.get_context('forkserver')
      mp.Pool(2).map(do(mp), range(3))
if __name__ == '__main__':
      test_forkserver()
======================================

Attached output:
------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/python3.10/lib/python3.10/multiprocessing/forkserver.py", line 258, in main
    fds = reduction.recvfds(s, MAXFDS_TO_SEND + 1)
  File "/usr/local/python3.10/lib/python3.10/multiprocessing/reduction.py", line 159, in recvfds
    raise EOFError
EOFError
...
------------------------------------------------------------------

System Info:
>>uname -a
Linux xxm 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

>>python -V
Python 3.10.0a4

----------
components: Library (Lib)
messages: 386008
nosy: xxm
priority: normal
severity: normal
status: open
title: Recursive call crash module multiprocessing
type: crash
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43081>
_______________________________________


More information about the New-bugs-announce mailing list