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

faulthandler: only allocate the signal handler stack when faulthandler is used #82032

Closed
vstinner opened this issue Aug 14, 2019 · 3 comments
Closed
Labels
3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@vstinner
Copy link
Member

BPO 37851
Nosy @vstinner
PRs
  • bpo-37851: faulthandler allocates its stack on demand #15358
  • 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 2019-08-21.12:41:58.560>
    created_at = <Date 2019-08-14.13:44:00.117>
    labels = ['library', '3.9']
    title = 'faulthandler: only allocate the signal handler stack when faulthandler is used'
    updated_at = <Date 2019-08-21.12:41:58.559>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-08-21.12:41:58.559>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-21.12:41:58.560>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2019-08-14.13:44:00.117>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37851
    keywords = ['patch']
    message_count = 3.0
    messages = ['349697', '350077', '350078']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['15358']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37851'
    versions = ['Python 3.9']

    @vstinner
    Copy link
    Member Author

    Currently at startup, Python always call _PyFaulthandler_Init() which allocates a stack of SIGSTKSZ bytes, even if faulthandler is never used. That's a waste of memory: the stack should be allocated the first time faulthandler is used.

    bpo-21131 requires to enlarge this stack size.

    @vstinner vstinner added 3.9 only security fixes stdlib Python modules in the Lib dir labels Aug 14, 2019
    @vstinner
    Copy link
    Member Author

    New changeset d8c5adf by Victor Stinner in branch 'master':
    bpo-37851: faulthandler allocates its stack on demand (GH-15358)
    d8c5adf

    @vstinner
    Copy link
    Member Author

    Note: faulthandler stack size is 16 KiB on my Fedora Linux 30 x86-64.

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

    No branches or pull requests

    1 participant