This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xxm
Recipients xxm
Date 2021-01-31.05:26:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612070816.14.0.20481029059.issue43081@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-01-31 05:26:56xxmsetrecipients: + xxm
2021-01-31 05:26:56xxmsetmessageid: <1612070816.14.0.20481029059.issue43081@roundup.psfhosted.org>
2021-01-31 05:26:56xxmlinkissue43081 messages
2021-01-31 05:26:55xxmcreate