0

I am looking for a way to prevent Windows from freezing. I know that because of the halting problem, there is no way to totally prevent any program from being in an infinite loop, but my problem is more tractable I think: I just want to detect freezes and do an action accordingly (kill process or reboot).

Sometimes, my work computer gets frozen for various reasons, which can range from a faulty program consuming too much RAM to an external USB hard drive that stops responding and makes the whole OS freeze.

However, I need my computer to always be up, because if it freezes it stops background computations that I left, and a freeze can go unnoticed, and it needs to be fixed in person (so no possibility to remotely fix by night for example), so a lot of time can eventually be lost.

What I am looking for:

  • a way to detect freezes on Windows (7 x64). Is there any standard method?
  • either kill the root of the freezes, or if not possible reboot the computer. Is it possible to detect the root of a freeze? Is it possible to (not physically) force reboot even during a freeze?

The end goal is that in case of a freeze, current computations might be lost but the computer will become available again ASAP (eg, for remote access to relaunch the computations).

My guess is that for such a program to work, it would need to run in ring0, above pretty much everything else, as to not get caught in the freeze (but that's a bet, I'm not sure if the freezes won't impact the ring0, but the freezes I target still allow for inputs to work like mouse and keyboard, so I guess ring0 might work too).

Constraints:

  1. Very restrictive network security measures (no outside access, only inside computers can access the outside, eg, only UDP hole punching works for remote computer access), so using a remotely controllable internet plug is impossible for example.

  2. No hardware change: I can plug additional hardwares to my computer, but I cannot modify the components already inside (eg, cannot change the motherboard, but can plug a PCI device or SATA or whatever).

For the moment, I am looking either for a software that can do this, or for technical information about how to do this myself (and if this might work or if that's just not possible), or any other solution that fits the constraints above.

I do not expect to fix every kinds of freezes using only a software solution, but I hope to at least workaround the type of "partial" freezes where the mouse and keyboard still work.

Thanks in advance.

NOTE: I am talking about non-BSOD freezes here. For BSOD freezes, Windows provide a setting to automatically reboot after kernel dump.

4
  • Additional infos: the freezes I have noticed were not "total" freezes, the mouse could still move and windows be switched, but every windows were unresponsive. This is mainly this kind of freeze I target, so it seems it's possible to do something. For example, I use this script to remotely reboot, when there is a freeze it still works but it takes hours instead of instantly.
    – gaborous
    Nov 10, 2016 at 13:40
  • If the mouse moves and the Windows can be focused, then the system is not frozen, just certain applications. The same general idea still applies though, you need something external to those programs to monitor and act. First, you need to determine which programs/processes, etc. you want to monitor, because if you can't define what you need to monitor, then you can't know when to act. Nov 10, 2016 at 13:49
  • @Ƭᴇcʜιᴇ007 It's a global freeze, I tracked down the issue to an USB external hard drive. This often happens, look Microsoft support forums (and other places). I don't know if it's the driver's issue (I already updated it before because of BSOD, this was fixed with the new one) or Windows faulty management of faulty storage devices, but anyway I would like a general solution for this type of freeze, not just this specific issue. I'm not expecting a jack-of-all-trades solution, but just an added layer of reliability given my technical constraints.
    – gaborous
    Nov 10, 2016 at 23:15
  • Also, the fact that the mouse can still move is what makes me think that a really high privilege monitor might still be able to do something, like the program managing the mouse. Hence my question.
    – gaborous
    Nov 10, 2016 at 23:17

1 Answer 1

1

If the OS is truly frozen, then nothing can run in the OS/software space to perform the reboot. So it sounds to me that you're looking for a motherboard with a Watchdog Timer in the BIOS. Unfortunately(?) those are usually only available on server-grade motherboards (and boards intended for embedded systems).

From Wikipedia:

A watchdog timer (sometimes called a computer operating properly or COP timer, or simply a watchdog) is an electronic timer that is used to detect and recover from computer malfunctions. During normal operation, the computer regularly resets the watchdog timer to prevent it from elapsing, or "timing out". If, due to a hardware fault or program error, the computer fails to reset the watchdog, the timer will elapse and generate a timeout signal. The timeout signal is used to initiate corrective action or actions. The corrective actions typically include placing the computer system in a safe state and restoring normal system operation.

You may also want to check out this other existing SU question:

5
  • That's a very interesting piece of hardware that I have never heard of before, thank you. I will look into this if everything else fails, but I would prefer something I can plug or program without replacing components (because I am not allowed to normally). I'll add a comment with more info about my issues, see above.
    – gaborous
    Nov 10, 2016 at 13:30
  • Honestly, now that I re-read the question I linked, I'd say yours is actually just a duplicate (as-is), so I'll be voting to close this as such. If you decide to do a homebrew implementation, feel free to come back with specific problems you may run into. :) Nov 10, 2016 at 13:33
  • The difference is that I am first looking for a software based solution (even one that I'd have to code myself). A hardware is very good but I'm not sure I can have that with our current security protocol (at least not right now).
    – gaborous
    Nov 10, 2016 at 13:41
  • In general you can't depend on a system (i.e. software running in an OS) to work when the system itself is frozen, because well, it is frozen -- and not advancing/responding. :) You need an external system to monitor for freezes and then act. Nov 10, 2016 at 13:45
  • Yes, and the motherboard solution will be perfect when I'll be able to order a new computer (if I can find a provider for these), but in my current environment it's not possible unluckily, so I'll have to settle for a less perfect solution... So I'm not going to accept your answer because it does not fit my constraints (sorry I added them after your answer...), but I will give you a bounty because that's a great answer.
    – gaborous
    Nov 10, 2016 at 23:18

Not the answer you're looking for? Browse other questions tagged .