Skip to content

Uninformative error message when working with semaphores #93253

Closed as not planned
@86Ilya

Description

@86Ilya

Bug report
Uninformative error message OSError: [Errno 28] No space left on device when working with semaphores
in "python3.8/multiprocessing/synchronize.py", line 57"
steps to reproduce:

docker run --shm-size="1m" -it python:3.8 python -c 'from multiprocessing import Array; myarr = [Array("b", 100) for _ in range(1000)]'

current behavior:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <listcomp>
  File "/usr/local/lib/python3.8/multiprocessing/context.py", line 141, in Array
    return Array(typecode_or_type, size_or_initializer, lock=lock,
  File "/usr/local/lib/python3.8/multiprocessing/sharedctypes.py", line 93, in Array
    lock = ctx.RLock()
  File "/usr/local/lib/python3.8/multiprocessing/context.py", line 73, in RLock
    return RLock(ctx=self.get_context())
  File "/usr/local/lib/python3.8/multiprocessing/synchronize.py", line 187, in __init__
    SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx)
  File "/usr/local/lib/python3.8/multiprocessing/synchronize.py", line 57, in __init__
    sl = self._semlock = _multiprocessing.SemLock(
OSError: [Errno 28] No space left on device

Your environment

  • CPython versions tested on: 3.8 3.9 3.10
  • Operating system and architecture: Linux r2d2 5.13.0-35-generic #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • docker: docker-ce 5:20.10.13~3-0~ubuntu-focal

How to fix:
Add a clearer message: There is not enough space in the file system to create a semaphore

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixespendingThe issue will be closed if no feedback is providedstdlibPython modules in the Lib dirtopic-multiprocessingtype-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions