Re: graceful recovery?!?


Subject: Re: graceful recovery?!?
From: Jesper Skov (jskov@redhat.com)
Date: Mon Jun 05 2000 - 05:16:59 CDT


>>>>> "Martin" == Martin Sevior <msevior@mccubbin.ph.unimelb.edu.au> writes:

>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>
>> On Sun, 4 Jun 2000, Jesper Skov wrote:
>>
>> > >>>>> "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; }
>> > >>

Martin> How about a "Put the insert point at he beginning of document
Martin> and appologize to the user" routine? It appears that the main
Martin> issue is that insert point has been lost. If we put the insert
Martin> point at the start of the document will things be alright
Martin> again or have the internal data structures been hopelessly
Martin> corrupted? Should we also save the document in a fail-safe
Martin> format? rtf? html? Ascii?

This is all fine, of course. Only issue is; there are a gazillion
places in the code where there's potential for jumping into Nirvana
via a NULL pointer. Do we want to add assertions to all those places -
more importanly, do we want to leave that assertion code enabled for
non-debug builds?

I don't think so. Assertions should be used for validating the code
during development. Crashes during regular use should be rare (since
we of course have a lot of assertions to help flush out bugs) - and if
they do happen, the user should probably try using a debug build to
reproduce and report the error.

As for graceful recovery; the check should not be in the code in the
form of assertions (in a production build). Instead there should be a
segv handler (surely there's an equivalent on Windows, BeOS, etc?)
which tries to save the document(s) in a configurable set of formats.

That handler should also try to print out some information about the
crash condition so the user has something for when filing the Bug.

I guess this is really a new feature (and something that would make
AbiWord stand apart from M$ Word too!)

"While AbiWord doesn't crash your computer every hour, it at least
tries to save your data when it does" (*)

Jesper

*: Danish humor -- I'm not sure it translates very well :) "my car
 doesn't go far on the galon, but at least it is expensive to repair
 and breaks down often"



This archive was generated by hypermail 2b25 : Mon Jun 05 2000 - 05:17:07 CDT