Subject: Re: graceful recovery?!?
From: sam th (sam@uchicago.edu)
Date: Sun Jun 04 2000 - 03:38:40 CDT
-----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; }
> >> 
> >> 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.
I realize that.  I just think that the while loop immediately preceeding
that assert makes it too easy to crash (although I can't think of a better
way to write it offhand).  But the crashes are somebody else's fault.
> 
> 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.
Yeah, once I write it. :-)  Should it be a dialog or a text message?  Most
people don't see text messages, in Windows or in X. 
> 
> 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.
> 
Fixed now.  Sorry for the flood of fwd's you just got.  Some of them are
interesting though.  ;->
> Jesper
> 
           
                                     sam th		     
                                     sam@uchicago.edu
                                http://sam.rh.uchicago.edu					
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE5OhWRt+kM0Mq9M/wRAk3WAKCBOfo94vjmA+WA8cskepLgVL6fKQCg2plm
FNJvOCDN5CFC4Pwf/YEPFBw=
=eXrj
-----END PGP SIGNATURE-----
This archive was generated by hypermail 2b25 : Sun Jun 04 2000 - 03:39:55 CDT