3 ms·
Recovery is never possible if the program has entered an unanticipated and unknown state.
by WalterBright 8y ago
Recovery is never possible if the program has entered an unanticipated and unknown state.
- temac 8y agoSo assertAndContinue makes no sense, right? On my side I don't really see its point anyway. If the code is actually ready to handle such failures, this is merely an error trace, so it should just be called that.
- WalterBright 8y ago> assertAndContinue I would never allow such a construct in any code I was in charge of.
- laurentl 8y ago> assertAndContinue OTOH, it’s the perfect title for a sequel of Halt and Catch Fire.
- alangpierce 8y ago> this is merely an error trace, so it should just be called that It's stricter than an error trace because if it's encountered in a development/testing context, it's a hard error and the engineer must fix it to proceed. Plain error traces should only be used for expected failure scenarios (like a third-party service times out, possibly), not situations that would be considered "unexpected" to the developer.
- temac 8y agoBut is the fallback path for production even correctly tested, then? And if it is, then what becomes the point of the assertion?
- gizmo686 8y agoNever is a strong word. Suppose the clock app on my phone fails an assert. Technically, this means that the entire phone system entered an unknown state; but there is a good chance that the bad state is contained within the failing app. In this case, it would be possible to recover by killing and restarting the offending process. Sure, it is possible that the crash was actually caused by bad state in the kernel, or even in the baseband processor, so we can't say for certain if restarting the app actually put us into a good state. However, the approach of isolating failures at the program level seems to have been greatly succesful at improving the reliability of the overall system. It does not seem unreasonable that when a "single" program becomes sufficiently complex, it would not benefit from a similar containment.
- WalterBright 8y agoThe process in an operating system with per-process memory protection is a reasonable level of containment for a consumer phone, and terminating/restarting the program is a reasonable solution. For a safety critical system, that isn't good enough. Put it this way - would you bet your life on it?