On Fri, 1 Dec 2006, Shawn Walker wrote:
Why for the life of me is I cannot understand your library calls abort() to crash the application because of out of memory

No debugged application on any modern system should ever run out of memory. Period. Even Microsoft agrees that 16-bit systems are dead and the corpse is rotting. On non-toy computers, "out of memory" was something that stopped happening sometime in the 1970s or 1980s.

If a malloc() call fails, the worst thing for the application to do in such a case is to engage in untested (and likely ill-conceived) recovery code that probably will make matters worse...including obscuring the place where the fault occurred.

There is a special place in hell for programmers who do things like
        foo = malloc (bar);
        if (foo == 0)
                return;

Not long ago, I wasted many hours tracking down a bug in a certain program (name withheld to protect the guilty) that had a bit of code very much like that above. It miscalculated bar (it was a negative value), and never did the action which followed that snippet.

or encounter an error from the server.

I have no idea what you are talking about here. The only abort()s in c-client are internal consistency checks. Nothing that a server can send will cause c-client to do an abort().

That is a big no no, please change your library to return a failure and have the application that is calling your library to deal with errors.

Sorry, but that isn't going to happen. I am not going to revoke an 18 year old old guarantee that certain c-client functions never fail; nor change the hundreds (if not thousands) of places which rely upon that guarantee.

If the applications refuses to check for errors, then that is their problem.

No, it's the problem of whomever has to deal with applications that sweep problems under the rug.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
_______________________________________________
Imap-uw mailing list
[email protected]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to