Skip to content

Don't attempt crash loop detection or automatic restarting on crash when running in secure mode#19238

Merged
SaschaCowley merged 1 commit into
masterfrom
fixCrashLoopDetection
Nov 19, 2025
Merged

Don't attempt crash loop detection or automatic restarting on crash when running in secure mode#19238
SaschaCowley merged 1 commit into
masterfrom
fixCrashLoopDetection

Conversation

@SaschaCowley

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #19216
Follow-up #19175

Summary of the issue:

NVDA was failing to start on secure screens, unless the serviceDebug global parameter was set.

Description of user facing changes:

NVDA works on secure desktops again.

Description of developer facing changes:

None

Description of development approach:

The issue was caused by utils._crashHandler.CrashStats.crashStatsPath assuming that globalVars.appArgs.logFileName would always represent a path. Notwithstanding this, it also wrote to disk, even when NVDAState.shouldWriteToDisk returned False (i.e. in scure mode or running from the launcher).

  1. Added several defensive measures to the new utils._crashHandler module.
  2. Changed watchdog.initialize to no longer add utils._crashHandler.crashHandler as an unhandled exception filter when running in secure mode.

Testing strategy:

Ran from source, and executed the following in the python console to ensure automatic restarts on crash still work as expected:

import ctypes;ctypes.windll.kernel32.DebugBreak()

Modified NVDA to allow the scratchpad in secure mode, built a self-signed launcher, and installed it.

Hit alt+control+delete, and observed that NVDA worked as expected.

Added the following global plugin to the scratchpad of the user and system config:

from globalPluginHandler import GlobalPlugin
import ctypes
from tones import beep
from core import postNvdaStartup

class GlobalPlugin(GlobalPlugin):
	def __init__(self):
		super().__init__()
		postNvdaStartup.register(self.crash)

	def crash(self):
		beep(500,100)
		ctypes.windll.kernel32.DebugBreak()

Restarted NVDA, and observed that it started, a tone was heard, and it crashed, and this only happened 4 times.

Hit alt+control+delete, and observed that NVDA started, a tone was heard, NVDA crashed, and did not restart.

Known issues with pull request:

When NVDA crashes on the secure desktop, no feedback is given to the user. However, this is not new.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@SaschaCowley SaschaCowley marked this pull request as ready for review November 19, 2025 03:29
@SaschaCowley SaschaCowley requested a review from a team as a code owner November 19, 2025 03:29

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SaschaCowley

@SaschaCowley SaschaCowley merged commit 36a2e7d into master Nov 19, 2025
77 of 79 checks passed
@SaschaCowley SaschaCowley deleted the fixCrashLoopDetection branch November 19, 2025 04:47
@github-actions github-actions Bot added this to the 2026.1 milestone Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA fails to read UAC (User Account Control)

2 participants