[asterisk-dev] policy change for correct handling of fatal program conditions

SF Markus Elfring elfring at users.sourceforge.net
Wed Jan 24 15:00:20 MST 2007


> Well, if not, then all calls fail in their own due time.  This is still the
> "right thing" to do, and you have not made an argument for why the process
> would do better to call exit().

The function "set_var" shows a simple example. It tries to add a 
variable to a global list in a thread-unsafe way. How important is this 
operation for correct program behaviour?
http://svn.digium.com/view/asterisk/trunk/utils/check_expr.c?rev=47232&view=markup

A memory allocation failure will be silently ignored there because the 
current function interface has got no means in the C programming 
language to report this error back to its caller. A C++ implementation 
would have got the opportunity to throw an exception. How many efforts 
would you like to invest to block or defer process termination?

Regards,
Markus


More information about the asterisk-dev mailing list