Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statically allocated Unicode objects leak cached representations #91240

Closed
jkloth opened this issue Mar 21, 2022 · 3 comments
Closed

Statically allocated Unicode objects leak cached representations #91240

jkloth opened this issue Mar 21, 2022 · 3 comments
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode

Comments

@jkloth
Copy link
Contributor

jkloth commented Mar 21, 2022

BPO 47084
Nosy @vstinner, @jkloth, @ezio-melotti
PRs
  • bpo-47084: Clear cached representations on finalization #32032
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2022-03-22.12:54:36.045>
    created_at = <Date 2022-03-21.18:37:52.463>
    labels = ['interpreter-core', 'expert-unicode', '3.11']
    title = 'Statically allocated Unicode objects leak cached representations'
    updated_at = <Date 2022-03-22.12:54:36.044>
    user = 'https://github.com/jkloth'

    bugs.python.org fields:

    activity = <Date 2022-03-22.12:54:36.044>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-03-22.12:54:36.045>
    closer = 'vstinner'
    components = ['Interpreter Core', 'Unicode']
    creation = <Date 2022-03-21.18:37:52.463>
    creator = 'jkloth'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47084
    keywords = ['patch']
    message_count = 3.0
    messages = ['415695', '415763', '415764']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'jkloth', 'ezio.melotti']
    pr_nums = ['32032']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue47084'
    versions = ['Python 3.11']

    @jkloth
    Copy link
    Contributor Author

    jkloth commented Mar 21, 2022

    The newly implemented statically allocated Unicode objects do not clear their cached representations (wstr and utf-8) at exit causing leaked blocks at exit (see also bpo-46857).

    At issue are the Unicode objects created by deepfreeze and the 1-character strings (ordinals < 256).

    @jkloth jkloth added 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode labels Mar 21, 2022
    @vstinner
    Copy link
    Member

    New changeset 88872a2 by Jeremy Kloth in branch 'main':
    bpo-47084: Clear Unicode cached representations on finalization (GH-32032)
    88872a2

    @vstinner
    Copy link
    Member

    The newly implemented statically allocated Unicode objects do not clear their cached representations (wstr and utf-8) at exit causing leaked blocks at exit (see also bpo-46857).

    Good job to discover this single leaking memory allocation!!!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants