Re: graceful recovery?!? (fwd)


Subject: Re: graceful recovery?!? (fwd)
From: sam th (sam@uchicago.edu)
Date: Sun Jun 04 2000 - 03:20:24 CDT


My email has not been getting to abiword-dev for the last couple days, so
I'm forwarding the last several messages

           
                                     sam th
                                     sam@uchicago.edu
                                http://sam.rh.uchicago.edu

---------- Forwarded message ----------
Date: Sun, 4 Jun 2000 02:58:06 -0500 (CDT)
From: sam th <sam@uchicago.edu>
To: Jesper Skov <jskov@redhat.com>
Cc: Martin Sevior <msevior@mccubbin.ph.unimelb.edu.au>,
     abiword developer list <abiword-dev@abisource.com>
Subject: Re: graceful recovery?!?

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.

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

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

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

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

PS - it seems like my messages to AbiWord-dev haven't been getting
through. Is this true?

                                     sam th
                                     sam@uchicago.edu
                                http://sam.rh.uchicago.edu
------------ Output from gpg ------------
gpg: Good signature from "Sam Tobin-Hochstadt <sytobinh@uchicago.edu>"



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