[issue45310] test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb'

STINNER Victor report at bugs.python.org
Tue Sep 28 08:22:19 EDT 2021


New submission from STINNER Victor <vstinner at python.org>:

AMD64 Fedora Stable LTO + PGO 3.10 (build 357):
https://buildbot.python.org/all/#/builders/651/builds/357

First test_multiprocessing_forkserver failed, then test_multiprocessing_spawn, then test_multiprocessing_fork.

I confirm that these tests fail if the /test01_tsmb shared memory exists.

The test is supposed to unlink the shared memory once the test completes:

    def test_shared_memory_basics(self):
        sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
        self.addCleanup(sms.unlink)

Maybe the whole process was killed while the test was running.

I removed it manually:

    sudo ./python -c "import _posixshmem; _posixshmem.shm_unlink('/test01_tsmb')"

Logs:

Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
KeyError: '/psm_49a93592'
(...)
======================================================================
ERROR: test_shared_memory_basics (test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/test/_test_multiprocessing.py", line 3777, in test_shared_memory_basics
    sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/shared_memory.py", line 103, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'

----------
components: Tests
messages: 402770
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_forkserver: test_shared_memory_basics() failed with FileExistsError: [Errno 17] File exists: '/test01_tsmb'
versions: Python 3.11

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


More information about the Python-bugs-list mailing list