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

os.wait3() leaks some uninitialized stack when no processes exist #80460

Closed
dw mannequin opened this issue Mar 13, 2019 · 3 comments
Closed

os.wait3() leaks some uninitialized stack when no processes exist #80460

dw mannequin opened this issue Mar 13, 2019 · 3 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@dw
Copy link
Mannequin

dw mannequin commented Mar 13, 2019

BPO 36279
Nosy @Yhg1s, @dw
PRs
  • bpo-36279: Ensure os.wait3() rusage is initialized #12303
  • bpo-36279: Ensure os.wait3() rusage is initialized #15111
  • Files
  • c805d2764e6a0ee4d22a338c5f4fef6154df8687.diff
  • 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-07-26.08:49:18.924>
    created_at = <Date 2019-03-13.03:27:40.023>
    labels = ['3.8', '3.7', 'library', 'performance']
    title = 'os.wait3() leaks some uninitialized stack when no processes exist'
    updated_at = <Date 2019-09-09.15:48:35.002>
    user = 'https://github.com/dw'

    bugs.python.org fields:

    activity = <Date 2019-09-09.15:48:35.002>
    actor = 'twouters'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-26.08:49:18.924>
    closer = 'dw'
    components = ['Library (Lib)']
    creation = <Date 2019-03-13.03:27:40.023>
    creator = 'dw'
    dependencies = []
    files = ['48507']
    hgrepos = []
    issue_num = 36279
    keywords = ['patch']
    message_count = 3.0
    messages = ['337833', '348484', '351506']
    nosy_count = 3.0
    nosy_names = ['twouters', 'neologix', 'dw']
    pr_nums = ['12303', '15111']
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue36279'
    versions = ['Python 3.7', 'Python 3.8']

    @dw
    Copy link
    Mannequin Author

    dw mannequin commented Mar 13, 2019

    Not sure if this is worth reporting..

    p = os.popen('sleep 1234')
    os.wait3(os.WNOHANG)
    os.wait3(os.WNOHANG)
    os.wait3(os.WNOHANG)

    Notice struct rusage return value. When wait3() succeeds on Linux, but no child was waiting to be reaped, &ru is not updated by the kernel, therefore it is passed uninitialized back to the user, essentially leaking a little bit of stack memory

    @SilentGhost SilentGhost mannequin added stdlib Python modules in the Lib dir 3.7 (EOL) end of life 3.8 only security fixes performance Performance or resource usage labels Mar 13, 2019
    @dw
    Copy link
    Mannequin Author

    dw mannequin commented Jul 26, 2019

    The original diff is attached here (per the old process) so others can find it, and the PR+fork are closed, as carrying a fork in my GitHub for 4 months has non-zero cost. I'm presently more interested in having a clean GH account than carrying around the baggage of forgotten old patches

    @dw dw mannequin closed this as completed Jul 26, 2019
    @Yhg1s
    Copy link
    Member

    Yhg1s commented Sep 9, 2019

    New changeset 682107c by T. Wouters (Zackery Spytz) in branch 'master':
    bpo-36279: Ensure os.wait3() rusage is initialized (GH-15111)
    682107c

    @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.7 (EOL) end of life 3.8 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant