Skip to content

Py_NewInterpreter causes bogus fatal error along the failure path #90128

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

Closed
hackhaslam mannequin opened this issue Dec 3, 2021 · 7 comments
Closed

Py_NewInterpreter causes bogus fatal error along the failure path #90128

hackhaslam mannequin opened this issue Dec 3, 2021 · 7 comments
Labels
3.11 only security fixes pending The issue will be closed if no feedback is provided topic-C-API type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@hackhaslam
Copy link
Mannequin

hackhaslam mannequin commented Dec 3, 2021

BPO 45970
Nosy @@hackhaslam
PRs
  • bpo-45970: Fix fatal error along the failure path of Py_NewIntperter #29900
  • 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 2021-12-03.05:35:05.839>
    labels = ['expert-C-API', 'type-crash', '3.11']
    title = 'Py_NewInterpreter causes bogus fatal error along the failure path'
    updated_at = <Date 2021-12-03.05:44:54.364>
    user = 'https://github.com/hackhaslam'

    bugs.python.org fields:

    activity = <Date 2021-12-03.05:44:54.364>
    actor = 'python-dev'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['C API']
    creation = <Date 2021-12-03.05:35:05.839>
    creator = 'jason.haslam'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45970
    keywords = ['patch']
    message_count = 1.0
    messages = ['407566']
    nosy_count = 2.0
    nosy_names = ['python-dev', 'jason.haslam']
    pr_nums = ['29900']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue45970'
    versions = ['Python 3.11']

    @hackhaslam
    Copy link
    Mannequin Author

    hackhaslam mannequin commented Dec 3, 2021

    The failure cleanup of Py_NewInterpreter causes a bogus fatal error on the call to PyThreadState_Delete. The error is about deleting the current thread state. The saved thread state should be swapped back in before deleting the new thread state.

    @hackhaslam hackhaslam mannequin added 3.11 only security fixes topic-C-API type-crash A hard crash of the interpreter, possibly with a core dump labels Dec 3, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @iritkatriel
    Copy link
    Member

    @hackhaslam can you provide a test to reproduce what you are reporting?

    @iritkatriel iritkatriel added the pending The issue will be closed if no feedback is provided label Nov 23, 2022
    @hackhaslam
    Copy link

    I can't remember any more what I did to cause Py_NewInterpreter to fail. It's okay. I gave up on this after I tried several times to sign the CLA without success.

    @iritkatriel
    Copy link
    Member

    We've moved to within since then and the CLA process has changed. Do you want to try again?

    Also, the PR would need a unit test so we need to know how to reproduce the bug.

    @iritkatriel
    Copy link
    Member

    CC @ericsnowcurrently

    @hackhaslam
    Copy link

    I don't remember what I was doing to get into the failure path. I can see a few different cases (lines with goto error in new_interpreter) but I don't know how to trigger any of them. The only obvious thing is not holding the GIL when calling Py_NewInterpreter, but that causes its own more immediate fatal error. As far as I'm concerned, this isn't worth pursuing any farther.

    @iritkatriel
    Copy link
    Member

    Ok, thanks. I'll close it then.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes pending The issue will be closed if no feedback is provided topic-C-API type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants