Martin Lichtin created AMQCPP-481:
-------------------------------------
Summary: NullPointerException while handling broker exception
Key: AMQCPP-481
URL: https://issues.apache.org/jira/browse/AMQCPP-481
Project: ActiveMQ C++ Client
Issue Type: Bug
Affects Versions: 3.5.0
Reporter: Martin Lichtin
Assignee: Timothy Bish
(Running with a modified library that aborts in case of a NullPointerException.)
(gdb) bt
#0 0x000000397b030265 in raise () from /lib64/libc.so.6
#1 0x000000397b031d10 in abort () from /lib64/libc.so.6
#2 0x00002aebc6308b48 in decaf::lang::Pointer<decaf::lang::Exception,
decaf::util::concurrent::atomic::AtomicRefCounter>::operator->
(this=0x15b32da8) at ./decaf/lang/Pointer.h:264
#3 0x00002aebc63065ad in
activemq::commands::BrokerError::createExceptionObject (this=0x15b32d50) at
activemq/commands/BrokerError.cpp:128
#4 0x00002aebc634956e in activemq::core::ActiveMQConnection::syncRequest
(this=0x2aaaac037600, command=..., timeout=0) at
activemq/core/ActiveMQConnection.cpp:1251
#5 0x00002aebc634b55b in activemq::core::ActiveMQConnection::asyncRequest
(this=0x2aaaac037600, command=..., onComplete=0x0) at
activemq/core/ActiveMQConnection.cpp:1275
#6 0x00002aebc6431de4 in activemq::core::kernels::ActiveMQSessionKernel::send
(this=0x2aaaac03daa0, producer=0x2aaaac040800, destination=...,
message=0x2aaaac0574b0, deliveryMode=0, priority=4, timeToLive=0,
producerWindow=0x0,
sendTimeout=0, onComplete=0x0) at
activemq/core/kernels/ActiveMQSessionKernel.cpp:985
#7 0x00002aebc64254e8 in activemq::core::kernels::ActiveMQProducerKernel::send
(this=0x2aaaac040800, destination=0x2aaaac040068, message=0x2aaaac0574b0,
deliveryMode=0, priority=4, timeToLive=0, onComplete=0x0)
at activemq/core/kernels/ActiveMQProducerKernel.cpp:269
#8 0x00002aebc6423c99 in activemq::core::kernels::ActiveMQProducerKernel::send
(this=0x2aaaac040800, message=0x2aaaac0574b0) at
activemq/core/kernels/ActiveMQProducerKernel.cpp:139
#9 0x00002aebc63cc270 in activemq::core::ActiveMQProducer::send
(this=0x2aaaac040de0, message=0x2aaaac0574b0) at
activemq/core/ActiveMQProducer.cpp:62
etc...
(gdb) frame 3
#3 0x00002aebc63065ad in
activemq::commands::BrokerError::createExceptionObject (this=0x15b32d50) at
activemq/commands/BrokerError.cpp:128
128 cause = new cms::CMSException(this->exCause->getMessage());
(gdb) p *this
$10 = {<activemq::commands::BaseCommand> = {<activemq::commands::Command> =
{<activemq::commands::BaseDataStructure> = {<activemq::commands::DataStructure>
= {<activemq::wireformat::MarshalAware> = {
_vptr.MarshalAware = 0x2aebc6c88230}, <No data fields>}, <No data
fields>}, <No data fields>}, responseRequired = false, commandId = 0}, message
= {static npos = 18446744073709551615,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> =
{<No data fields>}, <No data fields>}, _M_p = 0x15b2f528 "malformed input
around byte 0"}}, exceptionClass = {static npos = 18446744073709551615,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> =
{<No data fields>}, <No data fields>}, _M_p = 0x15b2f4e8
"java.io.UTFDataFormatException"}},
stackTraceElements =
{<std::_Vector_base<decaf::lang::Pointer<activemq::commands::BrokerError::StackTraceElement,
decaf::util::concurrent::atomic::AtomicRefCounter>,
std::allocator<decaf::lang::Pointer<activemq::commands::BrokerError::StackTraceElement,
decaf::util::concurrent::atomic::AtomicRefCounter> > >> = {
_M_impl =
{<std::allocator<decaf::lang::Pointer<activemq::commands::BrokerError::StackTraceElement,
decaf::util::concurrent::atomic::AtomicRefCounter> >> =
{<__gnu_cxx::new_allocator<decaf::lang::Pointer<activemq::commands::BrokerError::StackTraceElement,
decaf::util::concurrent::atomic::AtomicRefCounter> >> = {<No data fields>},
<No data fields>}, _M_start = 0x15b33dc0, _M_finish = 0x15b34120,
_M_end_of_storage = 0x15b34120}}, <No data fields>},
cause = {<decaf::util::concurrent::atomic::AtomicRefCounter> =
{_vptr.AtomicRefCounter = 0x2aebc6c88490, counter = 0x15b33cd0}, value = 0x0,
onDelete = 0x2aebc6307434
<decaf::lang::Pointer<activemq::commands::BrokerError,
decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(activemq::commands::BrokerError*)>},
exCause = {<decaf::util::concurrent::atomic::AtomicRefCounter> =
{_vptr.AtomicRefCounter = 0x2aebc6c884d0, counter = 0x15a9ec70}, value = 0x0,
onDelete = 0x2aebc6307348 <decaf::lang::Pointer<decaf::lang::Exception,
decaf::util::concurrent::atomic::AtomicRefCounter>::onDeleteFunc(decaf::lang::Exception*)>}}
(gdb) l
123 cause = new cms::UnsupportedOperationException(this->message);
124 } else {
125 if (exCause != NULL) {
126 cause = new cms::CMSException(this->message);
127 } else {
128 cause = new cms::CMSException(this->exCause->getMessage());
129 }
130 }
131
132 // Wrap in a Decaf exception to carry the pointer until it can be
The check on line 125 seems wrong. It should be ==, not?
--
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: http://www.atlassian.com/software/jira