Skip to content

Double release of import lock in _PyImport_LoadLazyImportTstate on PySet_Add failure #150374

Description

@lpyu001

Bug report

Bug description:

import.c:double lock release

_PyImport_LoadLazyImportTstate (line 3931): _PyImport_ReleaseLock called before goto error, then error path releases again → Py_FatalError("unlocking a recursive mutex not owned by current thread").

This is a sub-issue of #146102 with gist details

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Activity

  1. added a commit that references this issue on May 25, 2026
  2. added a commit that references this issue on May 25, 2026
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

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions