Skip to content

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

@lpyu001

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions