[New-bugs-announce] [issue37558] Shared memory tests are failing due to double slashes

Jakub Kulik report at bugs.python.org
Thu Jul 11 04:33:10 EDT 2019


New submission from Jakub Kulik <kulikjak at gmail.com>:

Hi,

with the addition of shared memory into Python 3.8, we now have three tests failing on Solaris, namely `test_multiprocessing_fork`, `test_multiprocessing_forkserver` and `test_multiprocessing_spawn`. All of them fail in the same way:

======================================================================
ERROR: test_shared_memory_cleaned_after_process_termination (test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../Python-3.8.0b2/Lib/test/_test_multiprocessing.py", line 4013, in test_shared_memory_cleaned_after_process_termination
    smm = shared_memory.SharedMemory(name, create=False)
  File ".../Python-3.8.0b2/Lib/multiprocessing/shared_memory.py", line 100, in __init__
    self._fd = _posixshmem.shm_open(
OSError: [Errno 22] Invalid argument: '//psm_5c1b5800'

The reason for this, in my opinion, is that the test suite is accessing private `sm._name` instead of the normalized `sm.name`. Returned value already has one slash prepended, and another one is prepended SharedMemory init is called, resulting in double slashes, which is incorrect.

Change to `sm.name` fixes this problem.

----------
components: Tests
messages: 347662
nosy: kulikjak
priority: normal
severity: normal
status: open
title: Shared memory tests are failing due to double slashes
type: behavior
versions: Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list