Hello,
I’ve been getting repeated system crashes on Windows 11 lately.
I start Gramps 6.0.4 and search by name using the filter, and suddenly an error message appears and the system restarts.
I can’t say exactly what the message says, as it disappears very quickly. However, I found an event log in the depths of Windows that appears to be related to the crash (it could be from the timing). I can’t reproduce the error either. It comes up whenever it wants…
Is it my system or Gramps?
Does the computer actually restart!?! Or does Gramps spontaneously exit?
If it is just Gramps exiting:
To preserve those console messages that disappear too quickly, Start Gramps from a command line prompt (not the app or console app icons shown below).
Discussions from Python community forums and GitHub issues reveal that Python 3.12 has experienced crashes due to Windows 11’s thread detector featureandnewer CPU models causing access violations (exception 0xc0000005), involving libpython3.12.dll. Downgrading to Python 3.11 or later patches might help.
Gramps includes a Python sandbox with the installation. It is not a full development environment. Rather, it is a minimal, bundled Python runtime environment.
BTW, this is one of my pet peeves in discussions about starting development (or morelike hacking) in Gramps. All the development docs start with setting up a full Python development environment. That’s a major investment in labor. I think it is reasonable that users will start tweaking WITHOUT a full environment. They will just patch using a text editor and leverage the bundled runtime.
Really? I don’t have Python on my home PC but I did have it on my work laptop. I don’t remember the installation being anything harder than downloading and the double clicking on the installer.
After Brian pointed out that newer Intel CPUs might have issues, I updated a few drivers and even found device drivers that hadn’t been installed automatically.
Now everything is up to date, and Gramps is running without any problems or crashes. It’s also somehow faster. It’s probably my happy hormones .
If Gramps can run on 3.9 and there are existing bios / device driver issues that occur with Window 11 and newer processors but not earlier Python DLLs, should the Gramps sandboxed runtime drop back to the earlier version for the next AIO maintenence 6.0.5?
The deciding factors are:
do the earlier Python DLL runtime versions resolve the same crash problems without the BIOS and/or device driver updates?
does the older DLL degrade performance? (Such as for multi-threaded efficiency.)
I wonder if there is a safe (or, at least, controlled) test that can determine if the crash WILL occur or during startup of Gramps. A crash during a data commit could lose work or corrupt the database. Or in other open Windows applications with unsaved data. It would certainly leave the tree in a locked state.
Further exploration with Perplexity indicates that dropping back to 3.11 is purported to avoid the crash under Windows 11 and might be optimal.
Single-Threaded Performance:
Python 3.9 is slower than Python 3.12: benchmarks show 3.12 is ~20–30% faster in many single-threaded scenarios thanks to interpreter optimizations, though 3.11 is often slightly faster than 3.12.dev
Where do we track the progress on this issue? I asked Perplexity to identify the properly isolated root cause. But where is it being worked?
What is the correct description for this bug affecting Python 3.12? Where it incorrectly calls the thread detector director, resulting in an exception code 0xc0000005
The correct description of the Python 3.12 bug affecting Windows 11 is:
Python 3.12’s runtime DLL (python312.dll) incorrectly invokes the Windows 11 thread detector director, which contains a bug particularly on advanced processors like the Intel 14900KS. This causes an access violation crash with exception code 0xc0000005. The crash typically occurs when Python scripts use threading or manage concurrent threads after initializing the interpreter in one thread and calling Python code from another thread, behavior that worked in Python versions prior to 3.12.
This issue is identified as a Windows 11 thread detector director bug triggered by python312.dll’s threading implementation, leading to a fault in Windows’ event viewer logs indicating the crash from mismatched thread detection direction or improper handling by Python 3.12.learn.microsoft+2
is it JUST the runtime? Or does the full Python development environment have the same problem?
The crash issue affecting Python 3.12 on Windows 11 is not limited to just the runtime DLL but impacts the full Python development environment. This means that whether running standalone Python scripts, Django management commands, or embedding Python in applications (e.g., via Boost.Python), the problem manifests due to a change in how Python 3.12 handles threading and interaction with Windows 11’s thread detector director.
Specifically:
The crash occurs when Python code is run on a different thread than the one used to initialize the interpreter (Py_Initialize). This was not an issue in previous Python versions.
It affects scripts, interactive sessions, and embedded development environments that start and run Python code with multiple threads.
Multiple user reports from Django apps, Qt5/Boost Python embedded scenarios, and general Python usage indicate the entire development environment is affected, not just Python.exe or python312.dll alone.
The problem triggers access violation exceptions (0xc0000005) related to Windows 11’s thread detector director.
Hence, the full Python 3.12 development environment, including runtime and multi-threaded application use cases, experiences this bug on affected Windows 11 hardware and OS versions.discuss.python+3
give a complete list of the processors (or processor families) that would be affected
The Python 3.12 crash issue related to the Windows 11 thread detector director affects processors with hybrid architectures and advanced thread scheduling, specifically:
Intel 13th Gen CPUs such as the Intel Core i9-14900KS are confirmed affected.
Intel 12th Gen hybrid architecture processors that include both performance (“P”) cores and efficiency (“E”) cores under Windows 11 Thread Director are implicated.
The bug arises due to Windows 11’s thread scheduling and thread detector director feature interacting incorrectly with Python 3.12’s threading implementation.
An older generation CPU like Intel i9-9900K (non-hybrid) reportedly does not experience this crash issue, suggesting the problem is specific to newer hybrid-architecture CPUs using Windows 11 thread director technology.
Other hybrid processor families with similar Windows 11 thread scheduling might also be affected, but explicit details chiefly mention Intel 12th Gen and 13th Gen processors with hybrid architectures under Windows 11.
If expanded beyond Intel, similar hybrid or performance/efficiency core architectures on Windows 11 from other vendors could theoretically be impacted, but specific confirmed reports focus on Intel’s advanced multi-core CPUs on Windows 11 platform.discuss.python+2
I believe the issue might be related to thread “director” and not “detector”. Again I purport no knowledge of the issue, throwing this out there so we don’t go on a wild goose chase.