python / python/cpython

IO streams locking can be broken after fork() with threads

Open
#84,579 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib topic-IO topic-multiprocessing type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

BPO 40399
Nosy @pitrou, @Delgan
Files
  • bug.py
  • 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 = None
    created_at = <Date 2020-04-26.16:58:22.058>
    labels = ['3.8', 'type-bug', 'library', '3.9']
    title = 'IO streams locking can be broken after fork() with threads'
    updated_at = <Date 2020-04-29.16:43:20.805>
    user = 'https://github.com/Delgan'
    

    bugs.python.org fields:

    activity = <Date 2020-04-29.16:43:20.805>
    actor = 'pitrou'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-04-26.16:58:22.058>
    creator = 'Delgan'
    dependencies = []
    files = ['49094']
    hgrepos = []
    issue_num = 40399
    keywords = []
    message_count = 8.0
    messages = ['367317', '367509', '367510', '367516', '367522', '367525', '367674', '367675']
    nosy_count = 2.0
    nosy_names = ['pitrou', 'Delgan']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40399'
    versions = ['Python 3.8', 'Python 3.9']
    

    Linked PRs
    • gh-128591

    Contributor guide

    Open the contributing guide

    First steps

    1. Read the whole issue, then the project's contributing guide.
    2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
    3. Fork the repository and make your change on a branch.
    4. Open a pull request that references the issue number.

    Research direction

    Start by reviewing the uploaded bug.py reproducer and the linked PR gh-128591, then trace the relevant CPython IO-stream behavior around fork() and threads. Confirm the reported locking failure and use the PR's current state to determine what remains; done means the reproduction no longer fails with appropriate regression coverage.

    Written by the indexing model from the issue text.

    Assessment

    Tech stack
    python
    Domain
    operating-systems
    Issue type
    Bug
    Difficulty
    4/5
    Estimated time
    3-5 days
    Activity status
    Stale
    Clarity
    Needs clarification
    Newbie friendliness
    25/100

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.