As explained in this thread
I recently had to learn the hard way that the propeller is somehow prone to runaway crashes where outputs are toggling in an uncontrolled way. As the propeller doesn't have a hardware watchdog nor memory protection it is very hard or impossible to actually protect memory from being overwritten. And, as I said, because of the OUTA and DIRA contents of all cogs being ORed together, there is also no way of stopping another cog from switching on outputs.
The propeller philosophy is: as little as possible dedicated hardware, do everything in software. So if we have one spare cog left we could at least do some sanity check and trigger a reset after we found out that something has gone wrong. This doesn't prevent a glitch on the outputs but it limits the possible damage.
In this thread I'd like to discuss ideas how a software watchdog could be implemented that hasn't to much impact on performance but can detect dangerous effects of serious software failures such as buffer overruns, stack overflow...
Of course there is no 100% saftey. A crashing cog executing garbage code could accidentally execute a cogstop for the watchdog cog. But if the watchdog detects illegal states and resets the whole propeller fast enough there's a good chance that nothing serious happens.