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

Clear _PyRuntime at exit #80905

Closed
vstinner opened this issue Apr 25, 2019 · 4 comments
Closed

Clear _PyRuntime at exit #80905

vstinner opened this issue Apr 25, 2019 · 4 comments
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-subinterpreters

Comments

@vstinner
Copy link
Member

BPO 36724
Nosy @vstinner, @ericsnowcurrently
PRs
  • bpo-36724: Add _PyWarnings_Fini() #12963
  • 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 2020-06-05.01:13:10.085>
    created_at = <Date 2019-04-25.20:13:49.450>
    labels = ['expert-subinterpreters', 'interpreter-core', '3.8']
    title = 'Clear _PyRuntime at exit'
    updated_at = <Date 2020-06-05.01:13:10.083>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-06-05.01:13:10.083>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-06-05.01:13:10.085>
    closer = 'vstinner'
    components = ['Interpreter Core', 'Subinterpreters']
    creation = <Date 2019-04-25.20:13:49.450>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36724
    keywords = ['patch']
    message_count = 4.0
    messages = ['340859', '340881', '344564', '370743']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'eric.snow']
    pr_nums = ['12963']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36724'
    versions = ['Python 3.8']

    @vstinner
    Copy link
    Member Author

    _PyRuntime.warnings is not cleared at Python exit: 3 objects are kept alive even after Py_Finalize().

    See bpo-36356 which cleared some other variables.

    PR 12453 "bpo-36356: Destroy the GIL at exit" is still open.

    @vstinner vstinner added 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Apr 25, 2019
    @vstinner
    Copy link
    Member Author

    New changeset 87d23a0 by Victor Stinner in branch 'master':
    bpo-36724: Add _PyWarnings_Fini() (bpo-12963)
    87d23a0

    @vstinner
    Copy link
    Member Author

    vstinner commented Jun 4, 2019

    bpo-36818 caused a regression: https://bugs.python.org/issue37135#msg344511

    We should be careful when we modify Python finalization, especially with daemon threads.

    @vstinner
    Copy link
    Member Author

    vstinner commented Jun 5, 2020

    _PyRuntime.warnings is not cleared at Python exit: 3 objects are kept alive even after Py_Finalize().

    This issue has been fixed. Moreover, the GC state is now per-interpreter.

    @vstinner vstinner closed this as completed Jun 5, 2020
    @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.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-subinterpreters
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant