Skip to content

Py_NewInterpreter causes bogus fatal error along the failure path #90128

Closed

Description

@hackhaslam
mannequin
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']

    Activity

    1. hackhaslam commented on Dec 3, 2021

      hackhaslammannequin
      MannequinAuthor

      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.

    2. added
      3.11only security fixes
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Dec 3, 2021
    3. transferred this issue fromon Apr 10, 2022
    4. iritkatriel commented on Nov 23, 2022

      @iritkatriel
      Member

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

    5. added
      pendingThe issue will be closed if no feedback is provided
      on Nov 23, 2022
    6. hackhaslam commented on Nov 23, 2022

      @hackhaslam
      Author

      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.

    7. iritkatriel commented on Nov 23, 2022

      @iritkatriel
      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.

    8. iritkatriel commented on Nov 23, 2022

      @iritkatriel
      Member
    9. hackhaslam commented on Nov 23, 2022

      @hackhaslam
      Author

      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.

    10. iritkatriel commented on Nov 23, 2022

      @iritkatriel
      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

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixespendingThe issue will be closed if no feedback is providedtopic-C-APItype-crashA hard crash of the interpreter, possibly with a core dump

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions