[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: abort() calls

From: Folker Schamel <schamel23_at_spinor.com>
Date: 2007-04-29 22:13:44 CEST

Stefan Küng wrote:
> Folker Schamel wrote:
>> Stefan Küng wrote:
>>> If there's any chance that the apr pools can clean up something, then
>>> the subversion lib should return an error and not call abort() at all.
>>> Because that's a situation which I would consider as manageable, and
>>> such situations should never call abort(). IMHO, abort() should only be
>>> used as the absolutely last resort, if really there's absolutely *no*
>>> other way to recover.
>>
>> What situation could that be?
>
> The only situation I can think of is out-of-memory. Then it's not
> possible to create an error anymore (that needs memory for the error
> string).

Which seems to be a problem with this particular error reporting mechanism,
but no principle problem.
For example, in C++, the bad_alloc exception does not have such a problem.

I would say it is even more important that out-of-memory does not abort(),
because out-of-memory situations can happen without being caused by
an application bug (e.g. in contrast to API contract violations).

> But there may be more situations. It's just that while looking through
> the code where abort() is currently used, there's every time a good
> chance to recover and return an error.
>
> Stefan

Cheers,
Folker

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 29 22:14:16 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.