Subject: Re: Possible changes to POSIX abort()
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 07/13/2002 07:42:49
>> The argument against this is that in situations where you need to
>> abort(), you have detected an inconsistency and need to bail out
>> immediately and core dump, without touching any state.

Perhaps, and that's probably true of some situations.  But there are
many others where it's worth at least _trying_ to flush stdio; most of
the abort() calls I write are can't-happens, and when one of them does
happen it has - so far! - always been light enough damage that flushing
stdio works and is reasonable.  (Often it's a logic bug, not, strictly
speaking, data structure corruption at all.)

While the argument

>> Having detected an inconcistency, there's no reason to believe that
>> *any* of your data structures, including stdio streams, aren't also
>> corrupt, so trying to flush streams or do other recovery work will
>> only hurt you.

holds some merit, I know _I_ would like to have something abort()ish
that does at least try to flush stdio.  I'd use it far more than I'd
use the version that doesn't.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B