GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Free threaded: slicing a shared memoryview raises `ValueError: operation forbidden on released memoryview object` · Issue #155606 · python/cpython

Free threaded: slicing a shared memoryview raises ValueError: operation forbidden on released memoryview object #155606

New issue
Copy link
New issue
Copy link
Open
Open
Free threaded: slicing a shared memoryview raises ValueError: operation forbidden on released memoryview object#155606
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@matteodellamico
matteodellamico
opened on Aug 12, 2026
Issue body actions

Bug report

Bug description:

Hello (and thanks for your amazing work),

I found that, on free threading Python, slicing a shared memoryview from several threads raises ValueError: operation forbidden on released memoryview object, even though nothing calls .release() and the underlying object is an immutable bytes. Stock (GIL) builds are unaffected.

data = bytes(1 << 20)
mv = memoryview(data)                   # ONE view, shared
# in each of 8 threads:  bytes(mv[0:64])

See the attached reproduction script. Results are not deterministic: not all threads raise an exception. Here are the results on my machine after running it:

$ PYTHON_GIL=0 python3.15t repro_shared_memoryview_threads.py
python 3.15.0rc1 gil_enabled=False: 3/8 threads FAILED -> ValueError('operation forbidden on released memoryview object')
$ PYTHON_GIL=1 python3.15t repro_shared_memoryview_threads.py
python 3.15.0rc1 gil_enabled=True: all 8 threads OK

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Linked PRs

  • gh-155606: Increment the managed buffer export count atomically #155882

Activity

  1. matteodellamico
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Aug 12, 2026
  2. aisk
    added
    topic-free-threading
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Aug 12, 2026
  3. ayaangazali
    added a commit that references this issue on Aug 19, 2026

    pythongh-155606: Increment the managed buffer export count atomically

    2f02ce9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.