You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Christian Mamen (JIRA)" <ji...@apache.org> on 2013/10/03 00:09:43 UTC

[jira] [Created] (AMQCPP-514) ActiveMQBytesMessage destruction may cause unhandle exception

Christian Mamen created AMQCPP-514:
--------------------------------------

             Summary: ActiveMQBytesMessage destruction may cause unhandle exception
                 Key: AMQCPP-514
                 URL: https://issues.apache.org/jira/browse/AMQCPP-514
             Project: ActiveMQ C++ Client
          Issue Type: Bug
    Affects Versions: 3.8.1
            Reporter: Christian Mamen
            Assignee: Timothy Bish


While creating a cms::bytesMessage and sending it in a function, i encounter an unhandle exception

the application code resemble this
{code}
void sendMessage()
{
    auto_ptr<cms::BytesMessage> msg( session->createBytesMessage() );

    // populate message
    [...]

    // send the message
    _producer->send( msg.get() );
}

void caller()
{
    try
    {
        sendMessage()
    }
    catch( cms::CMSException & ex )
    {
        // exception
    }
}
{code}

The call stack, when the unhandle exception happens, is the following

activemq-cpp.dll!activemq::commands::ActiveMQBytesMessage::storeContent() 
activemq-cpp.dll!activemq::commands::ActiveMQBytesMessage::reset() 
activemq-cpp.dll!activemq::commands::ActiveMQBytesMessage::~ActiveMQBytesMessage() 
activemq-cpp.dll!cms::CMSException::setMark(const char * file=0x00000000, const int lineNumber=1974618930) 
activemq-cpp.dll!activemq::commands::ActiveMQBytesMessage::storeContent() 

The exception from ActiveMQBytesMessage::storeContent() causes a double throw, from the send, and afterwards from the smart pointer when the message is destroyed

////

Im guessing that 
{code}
ActiveMQBytesMessage::~ActiveMQBytesMessage() throw() {
    this->reset();
}
{code}

should be something like :
{code}
ActiveMQBytesMessage::~ActiveMQBytesMessage() {
    try {    
        this->reset();
    }
    AMQ_CATCHALL_NOTHROW()
}
{code}









--
This message was sent by Atlassian JIRA
(v6.1#6144)