Skip to content

test_capi leaks references in free-threaded build #118085

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

Closed
Eclips4 opened this issue Apr 19, 2024 · 5 comments
Closed

test_capi leaks references in free-threaded build #118085

Eclips4 opened this issue Apr 19, 2024 · 5 comments
Labels
tests Tests in the Lib/test dir topic-free-threading type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented Apr 19, 2024

Bug report

Bug description:

./python.exe -m test -R 3:3 test_capi
Using random seed: 2679025675
0:00:00 load avg: 3.55 Run 1 test sequentially
0:00:00 load avg: 3.55 [1/1] test_capi
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1314, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
XTraceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1314, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
XTraceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1314, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
1Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1314, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
 1Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1314, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
1Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1314, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: module _test_module_state_shared does not support loading in subinterpreters
1
test_capi leaked [1, 1, 1] file descriptors, sum=3
test_capi failed (reference leak) in 53.0 sec

== Tests result: FAILURE ==

1 test failed:
    test_capi

Total duration: 53.0 sec
Total tests: run=864 skipped=63
Total test files: run=1/1 failed=1
Result: FAILURE

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

@Eclips4 Eclips4 added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir topic-free-threading labels Apr 19, 2024
@Eclips4
Copy link
Member Author

Eclips4 commented Apr 19, 2024

Sadly, I can't reproduce it constantly.

But, should this traceback really be printed?
I suggest to mark test_capi.tesc_misc.test_overridden_setting_extensions_subinterp_check and test_capi.test_misc.test_module_state_shared_in_global with a support.requires_gil_enabled decorator instead of expected_failure_if_gil_disabled.
cc @colesbury

@colesbury
Copy link
Contributor

Sadly, I can't reproduce it constantly.

Did this occur in the buildbots? Or locally?

But, should this traceback really be printed?

Yeah, the traceback is not ideal. I don't think there's an easy way to suppress it without skipping the test.

@Eclips4
Copy link
Member Author

Eclips4 commented Apr 19, 2024

Sadly, I can't reproduce it constantly.

Did this occur in the buildbots? Or locally?

It's happened locally. Perhaps I missed something while bisecting this (There's already a fix to a similar(same?) problem previously: #117780). So now it's looks for me like a false report.
One thing that remains - what we can do with this traceback.

@corona10
Copy link
Member

@Eclips4 I can not reproduce from my local environment (Fedora 40, gcc14, 0a1e8ff)
Is it still reproduced?

@Eclips4
Copy link
Member Author

Eclips4 commented Jun 29, 2024

No, it's not. Let's close it then. Thanks you Donghee for the reminder!

@Eclips4 Eclips4 closed this as completed Jun 29, 2024
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 topic-free-threading type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants