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 — Crash in garbage collection of the io.BytesIO buffer object · Issue #111211 · python/cpython

Crash in garbage collection of the io.BytesIO buffer object #111211

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Crash in garbage collection of the io.BytesIO buffer object#111211
Copy link
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixestype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@serhiy-storchaka
serhiy-storchaka
opened on Oct 23, 2023
Issue body actions

Crash report

What happened?

If the buffer created by io.BytesIO.getbuffer() is a part of a reference loop, the garbage collector can crash. Reproducer:

import gc, io
memio = io.BytesIO(b"1234567890")
buf = memio.getbuffer()
a = [buf]
a.append(a)
del memio, buf
del a
gc.collect()

It is because bytesiobuf_clear() clears self->source, but bytesiobuf_releasebuffer() uses it.

bytesiobuf_clear() was added in #101819.

CPython versions tested on:

3.12, CPython main branch

Operating systems tested on:

No response

Output from running 'python -VV' on the command line:

No response

Activity

  1. serhiy-storchaka
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    3.12only security fixesonly security fixes
    3.13only security fixesonly security fixes
    on Oct 23, 2023
  2. chgnrdv commented on Oct 23, 2023

    @chgnrdv
    chgnrdv
    on Oct 23, 2023
    Contributor
    More actions

    See also #111049

  3. serhiy-storchaka commented on Oct 23, 2023

    @serhiy-storchaka
    serhiy-storchaka
    on Oct 23, 2023
    MemberAuthor
    More actions

    Indeed, it is the same bug.

  4. serhiy-storchaka
    closed this as not plannedon Oct 23, 2023
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

    3.12only security fixesonly security fixes3.13only security fixesonly security fixestype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    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.