Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Resource tracker fails to track filenames with colons on Linux #98896

Closed
Labels
3.10only security fixes3.11only security fixes3.12only security fixestopic-multiprocessingtype-bugAn unexpected behavior, bug, or error
@maaleske

Description

@maaleske

Bug report

multiprocessing.resource_tracker fails to track files with a colon (':') in the filename due to a parsing error, allowing resource leaks. I originally encountered this while working with filenames that include ISO8601 timestamps with colons as time separators.

Minimal example:

$ python -c"from multiprocessing.shared_memory import SharedMemory; shm = SharedMemory(create=True, size=1, name='a:b')"$ Traceback (most recent call last):  File"/usr/lib/python3.10/multiprocessing/resource_tracker.py", line 199,in main    cmd, name, rtype =line.strip().decode('ascii').split(':')ValueError: too many values to unpack (expected 3)$ ls /dev/shm/a\:b/dev/shm/a:b

Without the colon, the file is correctly tracked and removed:

$ python -c"from multiprocessing.shared_memory import SharedMemory; shm = SharedMemory(create=True, size=1, name='ab')"$ /usr/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown  warnings.warn('resource_tracker: There appear to be %d'$ ls /dev/shm/abls: cannot access'/dev/shm/ab': No such file or directory

Your environment

  • CPython versions tested on: 3.10.7, 3.11.0, 3.12.0a1
  • Operating system and architecture: Fedora 35 x86_64 (3.10.7 from Fedora, others with Docker images)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixes3.12only security fixestopic-multiprocessingtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp