You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by CLIVE <cl...@ckjltd.co.uk> on 2014/06/16 13:51:27 UTC

qpid::messaging::Sender::getUnsettled causes segmentation fault

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-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: qpid::messaging::Sender::getUnsettled causes segmentation fault

Posted by Gordon Sim <gs...@redhat.com>.
On 06/16/2014 12:51 PM, CLIVE wrote:
> Encountered a condition that causes a certain usage of the
> qpid::messaging API to segmentation fault.
[...]
> Should I create a JIRA?

Yes please!

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


Re: qpid::messaging::Sender::getUnsettled causes segmentation fault

Posted by CLIVE <cl...@ckjltd.co.uk>.
I have associated this, and several other messaging API issues with 
QPID-5828.

On 16/06/2014 12:51, CLIVE wrote:
> 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-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
> .
>


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


Re: qpid::messaging::Sender::getUnsettled causes segmentation fault

Posted by Gordon Sim <gs...@redhat.com>.
On 06/16/2014 12:51 PM, CLIVE wrote:
> 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();
>          }
>        }

Fyi, I've created a fix for this: https://svn.apache.org/r1604785


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