Hi,

Encountered a condition that causes a certain usage of the qpid::messaging API to segmentation fault.

The following code will cause the failure (QpidBroker is just a class that starts and stops a QPID broker)

     QpidBroker broker;
     broker.start(5);

     qpid::messaging::Connection connection("localhost","");
     connection.open();

     qpid::messaging::Session  session  = connection.createSession();
qpid::messaging::Sender sender = session.createSender("amq.topic/fred");

     sender.setCapacity(100);

     // Stop the broker to simulate a broker/network failure,
     broker.stop(2);

     // Send messages, but do not send more than
     // capacity/4 as this causes a flush in the
     // sender implementation.
     for(uint32_t x=0; x < 10; ++x){
        qpid::messaging::Message message;
message.setContent(content + " : " + boost::lexical_cast<std::string>(x));
        try {
            sender.send(message,false);
        }
        catch(const qpid::types::Exception& qme){
             // EACH 'send' INVOCATION WILL CAUSE AN EXCEPTION REPORTING
             // NO CONNECTION. BUT MESSAGE WILL BE STORED IN THE SENDERS
             // OUTGOING QUEUE (ASSUMING THE SENDERS FLUSH MECHANISM
             // HASN'T BEEN ACTIVATED).
             //
             // IF THE OUTGOING QUEUE OF THE SENDER IMPLEMENTATION
// IS NON-ZERO A CALL TO 'getUnsettled' WILL CAUSE A SEGMENTATION
             // FAULT.
             sender.getUnsettled();
        }
      }

Stack trace is:

#0 0x00007f7051c2dcc6 in boost::shared_ptr<qpid::client::SessionImpl>::operator*() const () from libqpidclient.so.2 #1 0x00007f7051c2dbc0 in qpid::client::CompletionImpl::isComplete() () from libqpidclient.so.2 #2 0x00007f7051c2d91d in qpid::client::Completion::isComplete() () from libqpidclient.so.2 #3 0x00007f70521a551f in qpid::client::amqp0_10::SenderImpl::checkPendingSends(bool, qpid::sys::ScopedLock<qpid::sys::Mutex> const&) () from libqpidmessaging.so.2 #4 0x00007f70521a544b in qpid::client::amqp0_10::SenderImpl::checkPendingSends(bool) () from /libqpidmessaging.so.2 #5 0x00007f70521a5a8c in qpid::client::amqp0_10::SenderImpl::CheckPendingSends::operator()() () from libqpidmessaging.so.2 #6 0x00007f70521a6bbd in bool qpid::client::amqp0_10::SessionImpl::execute<qpid::client::amqp0_10::SenderImpl::CheckPendingSends (qpid::client::amqp0_10::SenderImpl::CheckPendingSends&) () from libqpidmessaging.so.2 #7 0x00007f70521a4d05 in qpid::client::amqp0_10::SenderImpl::getUnsettled() () from libqpidmessaging.so.2 #8 0x00007f70521b9347 in qpid::messaging::Sender::getUnsettled() () from/libqpidmessaging.so.2

Should I create a JIRA?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to