Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Calling `_imp.is_lazy_imports_enabled` in a thread hits an `assert(0)`

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start with Python/import.c at PyImport_IsLazyImportsEnabled and reproduce the assertion using the threaded _imp.is_lazy_imports_enabled example in the issue. Determine the expected behavior for that call and verify that the threaded invocation no longer aborts, including a regression test if the existing test layout provides a suitable entry point.

Written by the indexing model from the issue text.

Description

It's possible to hit an assert(0) in PyImport_IsLazyImportsEnabled by calling _imp.is_lazy_imports_enabled in a thread:

from threading import Thread
import _imp

Thread(target=_imp.is_lazy_imports_enabled, args=()).start()

Abort message:

python: Python/import.c:4640: PyImport_IsLazyImportsEnabled: Assertion `0' failed.
Aborted

I'm not sure this is relevant, but since it's the only fuzzing hit that happened in Cinder but not CPython, thought it better to report.

python -VV:

Python 3.12.4+meta (heads/meta/3.12:55b50e149d4, Dec  3 2024, 21:56:02) [GCC 11.4.0]

Found using fusil by @vstinner.

Dominant language
Python
Stars
3.8k
Forks
139
PR merge metrics
No merged PRs in 30d

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.

More from facebookincubator/MetaPython

All issues in facebookincubator/MetaPython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.