Re: graceful recovery?!?


Subject: Re: graceful recovery?!?
From: Jesper Skov (jskov@redhat.com)
Date: Sun Jun 04 2000 - 03:04:39 CDT


>>>>> "sam" == sam th <sam@uchicago.edu> writes:

sam> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

sam> On Sun, 4 Jun 2000, Jesper Skov wrote:

>> Just to follow up on this - what should be done? Is there a
>> graceful way to exit? The assert is a dead end - I could do this
>> instead:
>>
>> if (!pRun) { UT_ASSERT(UT_SHOULD_NOT_HAPPEN) x = 0; y = 0; return
>> NULL; }
>>
>> But it's likely to cause a crash immediately after the return since
>> the caller may be using the returned pointer for calls.

sam> I think that this situation is a bug. This assert should never
sam> be allowed to fire, since it is a sign that something has gone
sam> truly and horribly wrong. Total elminaton is probably not
sam> possible, but it's really easy in this code to get pRun == NULL.

How do you get to that conclusion? It should only happen if there's a
block which does not have any Runs in it which can hold the point. If
it happens, it is due to a bug somewhere else.

sam> However, in the absence of that fix, we should have something
sam> that allows us to kill the program immediately. Perhaps
sam> something like:

sam> if (!pRun) { UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
sam> UT_ERROR_MSG(("You've discovered a bug in \ AbiWord. Please
sam> report this to \ www.abisource.com/bugzilla.")); exit(); }

sam> I think this is better behavior than the core dump that will
sam> otherwise happen. And we really should be honest with our users.

UT_ERROR_MSG works both in debug and standard builds, I assume.

sam> PS - it seems like my messages to AbiWord-dev haven't been
sam> getting through. Is this true?
           
Yes, I've only received them as personal mail.

Jesper



This archive was generated by hypermail 2b25 : Sun Jun 04 2000 - 03:04:45 CDT