Skip to content
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

test_import fails on Refleak buildbots: assertion failed #119618

Closed
vstinner opened this issue May 27, 2024 · 4 comments
Closed

test_import fails on Refleak buildbots: assertion failed #119618

vstinner opened this issue May 27, 2024 · 4 comments
Assignees
Labels
tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

Example:

vstinner@mona$ ./python -m test test_import -R 3:3 -m test_check_state_first -v
(...)
test_check_state_first (test.test_import.SinglephaseInitTests.test_check_state_first) ...

python: ./Modules/_testsinglephase.c:714: PyInit__testsinglephase_with_reinit_check_cache_first: Assertion `_testsinglephase_with_reinit_check_cache_first.m_base.m_index == 0' failed.
Fatal Python error: Aborted

Current thread 0x00007f56b95a6740 (most recent call first):
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1316 in create_module
  File "<frozen importlib._bootstrap>", line 813 in module_from_spec
  File "<frozen importlib._bootstrap>", line 921 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 966 in _load
  File "/home/vstinner/python/main/Lib/test/test_import/__init__.py", line 2495 in _load_dynamic
  File "/home/vstinner/python/main/Lib/test/test_import/__init__.py", line 2894 in test_check_state_first
(...)

Regression: commit 0c5ebe1

commit 0c5ebe13e9937c446e9947c44f2570737ecca135
Author: Eric Snow <ericsnowcurrently@gmail.com>
Date:   Sat May 25 15:30:48 2024 -0400

    gh-119560: Drop an Invalid Assert in PyState_FindModule() (gh-119561)
    
    The assertion was added in gh-118532 but was based on the invalid assumption that PyState_FindModule() would only be called with an already-initialized module def.  I've added a test to make sure we don't make that assumption again.

@ericsnowcurrently: Can you please have a look?

@vstinner vstinner added the tests Tests in the Lib/test dir label May 27, 2024
@ericsnowcurrently
Copy link
Member

Yeah, I'll sort this out ASAP.

@AlexWaygood
Copy link
Member

Duplicate of #119584, I think?

@ericsnowcurrently ericsnowcurrently self-assigned this May 27, 2024
@ericsnowcurrently
Copy link
Member

Yeah, this has the same root cause.

@ericsnowcurrently
Copy link
Member

I've posted a fix: gh-119623.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

3 participants