Prevent repetitive crashes by only allowing NVDA to restart from a crash three times in two minute. (#19175)
Closes #19133
Summary of the issue:
If NVDA crashes somehow on startup, the watchdog restarts NVDA. This issue limits how many times the watchdog will atttempt to recover from crashes by preventing the crash handler from booting if the application has been in a boot loop of 3 or more crashes in one minute.
Description of user facing changes:
When NVDA gets itself into a crash loop, which is very rare, it can crash many times very rapidly. So rapidly that a user's keyboard is effectively locked from use. This issue prevents NVDA from crashing on repeat. Since NVDA often boots at startup, failure to gracefully bail can lock the users computer up every time the user logs in.
Description of developer facing changes:
The watchdog prevents crash handling code from booting on the fourth crash, by simply recording the timestamp of the last 3 crashes in a text file along side the crash dmp file, and then using the timestamps in a rolling window to decide if NVDA should start the crash handler, or gracefully allow shutdown.