activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: library function exception specification omitting std::bad_alloc
Date Tue, 17 Nov 2009 15:56:11 GMT
On Tue, 2009-11-17 at 10:49 -0500, Olivier Langlois wrote:
> Hi,
> 
> My server has been terminated when a std::bad_alloc has been thrown from the ActiveMQCPP
library and because this exception is not listed anywhere where the exception specification
is used by the library methods declaration.
> 
> I am questioning whether or not omitting std::bad_alloc from the exception specification
is the good thing to do.
> 
> We all agree that if this exception is happening it is an indication that there is a
memory leak somewhere. However, by letting this exception pass, that would allow the library
user to terminate nicely. In my context, that means closing all my network connections to
clients of my service and updating the access log files. This information is crucial and everytime
the server aborts the business loses money. That would also be inacceptable in a life critical
software.
> 
> For these reasons, I would suggest you to consider adding std::bad_alloc in all the library
exception specifications.
> 
> Olivier Langlois
> C++ Technical Lead
> 
> STREAMTHEWORLD
> 
> t. 1 866 448 4037 ext. 675
> t. 1 514 448 4037 ext. 675
> f. 1 514 807 1861
> 
> olivier.langlois@streamtheworld.com
> streamtheworld.com
>  
> StreamTheWorld launches its new BlackBerry application. Learn more
> 
> 

Do you have a stack trace showing which API call is allowing the
exception to be thrown?

Regards
Tim


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message