Repository navigation
"Windows fatal Exception: access violation" while testing 3.13.0b1 free-threading build (related to tkinter ?) #118973
Copy link
Copy link
Closed
Labels
3.13only security fixesonly security fixesOS-windowstopic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Crash report
What happened?
doing pytest on my github repository "sqlite-bro" , with Python-3.13.0b1 augmented per:
- "with free-threading binaries download" option checked
- tempfile.py patched with "_os.mkdir(file)" (zooba magic potion)
- python3.13t.exe renamed python.exe
- pythonw3.13t.exe renamed pythonw.exe
I get a crash
Details
C:\Users\stonebig\Documents\GitHub\sqlite_bro>pytest
====================================================================== test session starts =======================================================================
platform win32 -- Python 3.13.0b1, pytest-8.2.0, pluggy-1.5.0
rootdir: C:\Users\stonebig\Documents\GitHub\sqlite_bro
configfile: pyproject.toml
collecting ... Windows fatal exception: access violation
Current thread 0x00006b84 (most recent call first):
File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 1315 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 1331 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\tkinter\__init__.py", line 38 in <module>
File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 1021 in exec_module
File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
File "C:\Users\stonebig\Documents\GitHub\sqlite_bro\sqlite_bro\sqlite_bro.py", line 23 in <module>
File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 1021 in exec_module
File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1415 in _handle_fromlist
File "C:\Users\stonebig\Documents\GitHub\sqlite_bro\sqlite_bro\tests\test_general.py", line 7 in <module>
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\assertion\rewrite.py", line 178 in exec_module
File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
File "<frozen importlib._bootstrap>", line 1387 in _gcd_import
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\importlib\__init__.py", line 88 in import_module
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\pathlib.py", line 591 in import_path
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\python.py", line 487 in importtestmodule
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\python.py", line 540 in _getobj
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\python.py", line 282 in obj
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\python.py", line 556 in _register_setup_module_fixture
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\python.py", line 543 in collect
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\runner.py", line 389 in collect
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\runner.py", line 341 in from_call
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\runner.py", line 391 in pytest_make_collect_report
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\runner.py", line 565 in collect_one_node
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 837 in _collect_one_node
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 974 in genitems
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 979 in genitems
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 979 in genitems
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 979 in genitems
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 811 in perform_collect
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 349 in pytest_collection
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 338 in _main
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 285 in wrap_session
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\main.py", line 332 in pytest_cmdline_main
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_callers.py", line 103 in _multicall
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_manager.py", line 120 in _hookexec
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\pluggy\_hooks.py", line 513 in __call__
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\config\__init__.py", line 178 in main
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Lib\site-packages\_pytest\config\__init__.py", line 206 in console_main
File "C:...\WPy64-31300b1\python-3.13.0b1.amd64\Scripts\pytest.exe\__main__.py", line 7 in <module>
File "<frozen runpy>", line 88 in _run_code
File "<frozen runpy>", line 198 in _run_module_as_main
on 3.13.0b1 patched the same but not Free-threading all seems ok
Details
================================================= test session starts =================================================
platform win32 -- Python 3.13.0b1, pytest-8.2.0, pluggy-1.5.0
rootdir: C:\Users\stonebig\Documents\GitHub\sqlite_bro
configfile: pyproject.toml
collected 3 items
sqlite_bro\tests\test_general.py ... [100%]
================================================== 3 passed in 0.76s ==================================================
I did that test because IDLE doesn't want to start and doesn't say why.
Package set used:
Package Version Summary
_______________ ____________ ______________________________________________________________________
build 1.1.1 A simple, correct Python build frontend
colorama 0.4.6 Cross-platform colored terminal text.
iniconfig 2.0.0 brain-dead simple config-ini parsing
packaging 23.2 Core utilities for Python packages
pip 24.0 The PyPA recommended tool for installing Python packages.
pluggy 1.5.0 plugin and hook calling mechanisms for python
pyproject-hooks 1.0.0 Wrappers to call pyproject.toml-based build backend hooks.
pytest 8.2.0 pytest: simple powerful testing with Python
setuptools 69.2.0 Easily download, build, install, upgrade, and uninstall Python package
sqlite-bro 0.13.1 a graphic SQLite Client in 1 Python file
wheel 0.43.0 A built-package format for Python
winpython 8.0.20240512 WinPython distribution tools, including WPPM
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Output from running 'python -VV' on the command line:
Python 3.13.0b1 (tags/v3.13.0b1:2268289, May 8 2024, 12:31:50) [MSC v.1938 64 bit (AMD64)]
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.13only security fixesonly security fixesOS-windowstopic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Activity
stonebig commentedon May 13, 2024
maybe related to this still missing piece ? colesbury/nogil-3.12@78825e0508

KRRT7 commentedon Jun 23, 2024
simply importing
crashes 3.13t for me, which is imported in the sqlite_bro project. hope this helps narrow down the issue.
stonebig commentedon Jun 23, 2024
By the look of current early state of free-threading, we may assume the tkinter/free-threading is rather a 2025 question, with uncertain fate.
python-zhong commentedon Jul 2, 2024
I tried to use WinDbg to debug it, and found:
mishaturnbull commentedon Oct 9, 2024
+1 for this happening on Windows only, version 3.13.0 (non-beta, release day build). I see exactly the same error as @python-zhong when running
python3.13t.exe -m tkinterunder WinDbg (no pytest involved). The tkinter test dialog launches and operates correctly when not in free-threading mode (GIL enabled) on the same machine. I tested the same command on a Debian platform (compiled the same 3.13.0 tag), and it worked flawlessly in free-threaded mode. Don't have a mac to test on, unfortunately.Platform details:
Windows 10 22H2 build 19045.4894
py -3.13 -VV-->Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)]py -3.13t -VV-->Python 3.13.0 experimental free-threading build (tags/v3.13.0:60403a5, Oct 7 2024, 09:53:29) [MSC v.1941 64 bit (AMD64)]Linux [hostname] 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 GNU/Linux./python -VV-->Python 3.13.0 experimental free-threading build (tags/v3.13.0:60403a5409, Oct 8 2024, 23:03:36) [GCC 10.2.1 20210110]colesbury commentedon Oct 9, 2024
@zooba The official Windows installer (with free-threading binaries) only includes a
Python313\DLLs\_tkinter.pyd. There's no_tkinter.cp313t-win_amd64, so importingtkinterinpy -3.13tcrashes as it tries to load an incompatible extension.Do you know why that's happening?
terryjreedy commentedon Oct 9, 2024
As noted in #125179 (comment), I have run tkinter and IDLE on debug + free-threading builds since last March. But I never tried the installers. Of course, PCbuild/amd64 has a full set of _xyz_d.cp314t-win_amd64.ext files. I'm sorry I did not notice this issue before.
mishaturnbull commentedon Oct 10, 2024
Yep, figured out the free-threading build on the same Windows box (sorry about the delay, Visual Studio noob), and when compiled locally
tkinteroperates flawlessly on free-threading.Admittedly, I've just compiled Cpython for the first time yesterday -- but, if this is simple to fix, I'd be happy to submit a PR for it if that would help?
zooba commentedon Nov 12, 2024
Yeah, looks like I copied the list of extensions from the
libpackage but not thetcltkpackage. Easy enough to add it in, I'll get itpythongh-118973: Add _tkinter to freethreaded MSI
gh-118973: Add _tkinter to freethreaded MSI (GH-126768)
pythongh-118973: Add _tkinter to freethreaded MSI (pythonGH-126768)
gh-118973: Add _tkinter to freethreaded MSI (GH-126768)
leycec commentedon Nov 24, 2024
Necrobump. I just hit something like this at @beartype. For unknown reasons, @beartype's
pytesttest suite fails with a similar inscrutable threading error in Python3.13.0under the GitHub Actions Windows runner:Tkinter doesn't appear to be implicated here. Threading, however, does.
Does the GitHub Actions Windows runner actually ship a free-threading build of Python 3.13? That... would be super-weird. Since I can't meaningfully parse the above stacktrace, I'm reluctantly blacklisting the Python 3.13 + Windows combo in our build matrix. Weep for @beartype's QA, GitHub! 😭
[CI] Python 3.13.0 + Windows x 1.
colesbury commentedon Nov 24, 2024
No it doesn't.
The error message:
Looks the same as in #125842, which is fixed in the upcoming 3.13.1 release.
leycec commentedon Nov 24, 2024
Wondressness! Thanks so much for the heads up, @colesbury. Google came up surprisingly empty when I grepped that
SystemError. I can now rest easy knowing that someone smarter than me has fixed something I don't understand. 😄pythongh-118973: Add _tkinter to freethreaded MSI (pythonGH-126768)
pythongh-118973: Add _tkinter to freethreaded MSI (pythonGH-126768)
colesbury commentedon Mar 17, 2025
I think this is fixed now.
stonebig commentedon Mar 17, 2025
indeed... Free-threading is working now on this test, in 3.14.0a6 on windows