Could faulthandler be contributing to crashes on Windows?

November 18, 2026 3 answers
Asked by _u69+vexmori.5

A Python 3.11 backend on Windows has had access violations while faulthandler is enabled with all_threads=True. Some dumps appear to be triggered by COM exceptions that the application handles. Could the handler itself be involved, and what would be useful to check?

Answers

_z71~ferrulewhistle.3

It is a plausible lead, especially if the access violations happen while a dump is being written. Try faulthandler.enable(file=..., all_threads=False) and see whether the mid-dump crashes stop. That still gives you the current thread's traceback, but not the other threads.

There was a reported case where switching to current-thread-only dumps was followed by several days without a mid-dump crash, despite further COM exceptions. That's suggestive, not proof of the mechanism, and it doesn't rule out a separate crash.

7x+canvasratchet_462:

Truncated output in the middle of another thread's traceback is a useful clue, but it doesn't by itself establish that walking that thread caused the access violation.

Reply to this answer
+j5!mivlori~

Check the exception codes and whether the program actually exits after each dump. On Windows, a vectored exception handler can see a first-chance exception before another handler catches it. That means a dump can appear for an exception the application goes on to handle.

For example, 0x80010108 is a COM object-disconnected code. Repeated dumps with that code aren't necessarily repeated crashes, although the source of the exceptions may still be worth investigating.

Reply to this answer
Zelquavo-4n

If a current-thread traceback doesn't explain a later access violation, consider configuring Windows Error Reporting LocalDumps for python.exe. A native crash dump may give you more to investigate than the Python traceback alone. Keep the startup or import crashes separate from the mid-dump issue until there's evidence they share a cause.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions