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

[subinterpreters] Convert "global" static variable caches in _json to heap variables #87000

Closed
Fidget-Spinner opened this issue Jan 5, 2021 · 5 comments
Labels
3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir topic-subinterpreters

Comments

@Fidget-Spinner
Copy link
Member

BPO 42834
Nosy @vstinner, @tiran, @ericsnowcurrently, @Fidget-Spinner
PRs
  • bpo-42834: Make static cache variables in _json.c compatible with subinterpreters #24121
  • bpo-44156: Make cached string constants in compile.c subinterpreter compatible #26161
  • 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 2021-05-17.06:36:25.218>
    created_at = <Date 2021-01-05.15:54:05.048>
    labels = ['expert-subinterpreters', 'library', '3.10', '3.11']
    title = '[subinterpreters] Convert "global" static variable caches in _json to heap variables'
    updated_at = <Date 2021-05-17.09:36:06.094>
    user = 'https://github.com/Fidget-Spinner'

    bugs.python.org fields:

    activity = <Date 2021-05-17.09:36:06.094>
    actor = 'kj'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-05-17.06:36:25.218>
    closer = 'christian.heimes'
    components = ['Library (Lib)', 'Subinterpreters']
    creation = <Date 2021-01-05.15:54:05.048>
    creator = 'kj'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42834
    keywords = ['patch']
    message_count = 5.0
    messages = ['384411', '386081', '393741', '393786', '393801']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'christian.heimes', 'eric.snow', 'kj']
    pr_nums = ['24121', '26161']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42834'
    versions = ['Python 3.10', 'Python 3.11']

    @Fidget-Spinner
    Copy link
    Member Author

    _json currently uses a few static locals for caching of PyUnicode and one Exception object. This patch aims to move them to the heap.

    Apologies if this isn't the right way to track subinterpreter issues, I took a look at bpo-36876 but it seemed like a meta issue to me.

    @Fidget-Spinner Fidget-Spinner added 3.10 only security fixes stdlib Python modules in the Lib dir topic-subinterpreters labels Jan 5, 2021
    @vstinner
    Copy link
    Member

    vstinner commented Feb 1, 2021

    New changeset b5931f1 by Ken Jin in branch 'master':
    bpo-42834: Fix _json internal caches for subinterpreters (GH-24121)
    b5931f1

    @vstinner vstinner closed this as completed Feb 1, 2021
    @Fidget-Spinner
    Copy link
    Member Author

    Hi Victor, I'm re-using this issue as I'm doing a similar change to compile.c. I hope you're alright with that.

    @Fidget-Spinner Fidget-Spinner added the 3.11 only security fixes label May 16, 2021
    @Fidget-Spinner Fidget-Spinner changed the title [subinterpreters] Convert "global" static variable caches in _json to heap variables [subinterpreters] Make static caches in various places subinterpreter compatible May 16, 2021
    @tiran
    Copy link
    Member

    tiran commented May 17, 2021

    KJ, please create a new bug for compile.c. bpo's are cheap to create.

    @tiran tiran closed this as completed May 17, 2021
    @tiran tiran changed the title [subinterpreters] Make static caches in various places subinterpreter compatible [subinterpreters] Convert "global" static variable caches in _json to heap variables May 17, 2021
    @Fidget-Spinner
    Copy link
    Member Author

    Hi Christian and Victor, thanks for the advice! Points taken. I'll keep in mind to create a new issue for similar things in the future so things are less confusing for everyone.

    The new issue for this is bpo-44156.

    @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.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir topic-subinterpreters
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants