activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <>
Subject [jira] [Commented] (AMQCPP-490) Exception lifetime confusion can cause the application to crash
Date Thu, 13 Jun 2013 16:33:20 GMT


Timothy Bish commented on AMQCPP-490:

Added fixes for the indicated files, if you want to attach tests or add more locations of
problems please do. 
> Exception lifetime confusion can cause the application to crash
> ---------------------------------------------------------------
>                 Key: AMQCPP-490
>                 URL:
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl, Decaf
>    Affects Versions: 3.5.0, 3.6.0, 3.7.0
>            Reporter: Jonathan Fortier
>            Assignee: Timothy Bish
> In changeset #139775, the "decaf::lang::Exception" class changed its ownership policy
for its std::exception cause. Before the changeset, Exception class would clone the cause,
and after the change, the Exception class took ownership of the std::exception. 
> However, many code paths still assume that the Exception class will clone the std::exception,
which makes the application crash when a std::exception is thrown in their protected region.
> Here is a incomplete list of places in the code that makes this bad assumption (line
numbers from version 3.7.0):
> -decaf\util\concurrent\FutureTask.h, line 272
> -decaf\util\concurrent\FutureTask.h, line 301
> -decaf\util\concurrent\ThreadPoolExecutor.cpp, line 742
> -activemq\core\ActiveMQTransactionContext.cpp, line 646
> -activemq\core\ActiveMQTransactionContext.cpp, line 757
> -decaf\internal\net\tcp\TcpSocket.cpp, line 361
> Note that subclasses of Exception may also be affected, since they normally forward the
cause to their parent. 
> The comments on many of those classes still wrongly indicates that the cause will be
cloned. For example, the comments for Exception::Exception(const std::exception*) is inconsistent
with the comments for Exception::initCause()
> An easy way to reproduce the bug is to throw a std::exception from an onException callback,
which should make the application crash.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message