Program logic bugs vs input/environmental errors
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Sun Sep 28 13:31:01 PDT 2014
On 9/28/2014 12:38 PM, Sean Kelly wrote:
>> Exceptions are meant for RECOVERABLE errors. If you're using them instead of
>> assert for logic bugs, you're looking at undefined behavior. Logic bugs are
>> not recoverable.
>
> In a multithreaded program, does this mean that the thread must be terminated or
> the entire process? In a multi-user system, does this mean the transaction or
> the entire process? The scope of a logic bug can be known to be quite limited.
> Remember my earlier point about Erlang, where a "process" there is actually just
> a logical thread in the VM.
This has been asked many times before.
If the threads share memory, the only robust choice is to terminate all the
threads and the application.
If the thread is in another process, where the memory is not shared, then
terminating and possibly restarting that process is quite acceptable.
> The scope of a logic bug can be known to be quite limited.
If you know about the bug, then you'd have fixed it already instead of inserting
recovery code for unknown problems. I can't really accept that one has "unknown
bugs of known scope".
More information about the Digitalmars-d
mailing list