# Python on Windows unpredictably closing with no error. Logs show ntdll.dll fault

**URL:** <https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865>\
**Category:** Python Help\
**Tags:** help\
**Created:** [November 13, 2025, 4:32pm UTC](https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865 "2025-11-13T16:32:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![curtis.mack](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@curtis.mack](https://discuss.python.org/u/curtis.mack)\
**Post date:** [November 13, 2025, 4:32pm UTC](https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865/1 "2025-11-13T16:32:20Z")

</div>

Hi,  
I have a moderately large code base that relies heavily on Pandas and SQL Alchemy. I am slowly converting a process from SAS to Python, so I am also using SasPy to interface with that older code.

I am having a bad problem with long running jobs just stopping without any errors to the log. The Event Viewer always shows something similar to this:

`Faulting application name: python.exe, version: 3.12.10150.1013, time stamp: 0x67f515a7`  
`Faulting module name: ntdll.dll, version: 10.0.26100.7019, time stamp: 0x9c8f8241`  
`Exception code: 0xc0000006`  
`Fault offset: 0x000000000000e02d`  
`Faulting process id: 0xBF0`  
`Faulting application start time: 0x1DC54B69ACC601F`  
`Faulting application path: C:\Users\Curtis.Mack\AppData\Local\Programs\Python\Python312\python.exe`  
`Faulting module path: C:\Windows\SYSTEM32\ntdll.dll`  
`Report Id: 04f685f9-6c15-47a0-9141-435ff10e13ff`  
`Faulting package full name:`  
`Faulting package-relative application ID:`

I have had some success increasing the likelihood of a job completing by deleting dataframes as soon a they are no longer needed and calling gc.collect(). But this is not a complete fix. It is much more common when running in the debugger. I am getting nowhere near exceeding the machine’s memory (256GB).

I am running Python 3.12.10 in VS Code on a Windows 11 (10.0.26100) machine using AMD Ryzen 7965WX chips and 256GB of RAM.

Thanks for reading to the bottom of this.

---

<div class="post-metadata">

**Author:** ![JamesParrott](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jamesparrott/32/10534_2.png) [@JamesParrott](https://discuss.python.org/u/JamesParrott)\
**Post date:** [November 13, 2025, 5:20pm UTC](https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865/2 "2025-11-13T17:20:12Z")

</div>

I can’t suggest anything constructive I’m afraid. But I note that problems involving ntdll.dll are widespread with other frameworks and languages, and are certainly not exclusive to Python.

---

<div class="post-metadata">

**Author:** ![c-rob](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/c-rob/32/17261_2.png) [@c-rob](https://discuss.python.org/u/c-rob)\
**Post date:** [November 13, 2025, 5:55pm UTC](https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865/3 "2025-11-13T17:55:37Z")

</div>

I use Windows with Python 3.14. In cases like this I reboot the system. If something like this happens often enough, something else is going on, perhaps a file is corrupted in Windows.

Because I see weird errors like this every 2-3 weeks I shut down my PC every Friday after work, which means it’s a fresh reboot Monday morning. That solves most of my problems.

I also install any required Windows updates that are pending. In the past 10 months I’ve personally had the microphone not work 3 times due to a pending Windows update. I know it’s not your error but Windows updates can sometimes do bizarre things.

---

<div class="post-metadata">

**Author:** ![curtis.mack](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@curtis.mack](https://discuss.python.org/u/curtis.mack)\
**Post date:** [November 13, 2025, 6:50pm UTC](https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865/4 "2025-11-13T18:50:47Z")

</div>

Thank for the input. Unfortunately, I had the error shortly after rebooting for a full update.

---

<div class="post-metadata">

**Author:** ![c-rob](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/c-rob/32/17261_2.png) [@c-rob](https://discuss.python.org/u/c-rob)\
**Post date:** [November 14, 2025, 9:51am UTC](https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865/5 "2025-11-14T09:51:37Z")

</div>

There was one rare case (a first time actually in October 2025) where I had to reboot a second time after an update before things would work. Try rebooting again.

1. Also, can you upgrade Python? That might also work.
2. Did you install all non-critical Windows updates?
3. Do you have the latest Windows 11 from 2025? I don’t even have the latest Win 11 but what I do have is: Windows 11 v23H2 (OS Build 22631.6199) Run “winver” at a command prompt.

---

<div class="post-metadata">

**Author:** ![Jos\_Verlinde](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jos_verlinde/32/25571_2.png) [@Jos\_Verlinde](https://discuss.python.org/u/Jos_Verlinde)\
**Post date:** [November 14, 2025, 6:50pm UTC](https://discuss.python.org/t/python-on-windows-unpredictably-closing-with-no-error-logs-show-ntdll-dll-fault/104865/6 "2025-11-14T18:50:27Z")

</div>

Id suggest starting by getting more information about the python crash. There are many ways to do this, such as:

- Enable Python’s faulthandler module

Add import faulthandler; faulthandler.enable() at the start of your script. This forces Python to dump tracebacks on crashes, which can reveal where execution was when the process died.

- Use Windows Debugging Tools (WinDbg)

Attach WinDbg to your Python process before running. When the crash occurs, you’ll get a detailed stack trace inside ntdll.dll and can see if it’s triggered by memory access, I/O, or something else.

- Generate a crash dump

Configure Windows Error Reporting (WER) or use Sysinternals’ procdump to capture a full memory dump when python.exe crashes. You can then analyze it with WinDbg or Visual Studio

- Run with PYTHONVERBOSE

Launch Python with python -v or set PYTHONVERBOSE=1 in the environment. This gives detailed import and execution logs, which may help spot where things go 🍐shaped
