On 07/01/2014 10:37 AM, Lyubov Romanchuk wrote:
Hi,

Thank you for the response.
1) It's very hard to support the test case for reproduction of this issue 
because  I don't know the root cause of the core and we have too complicated 
environment in order to try to simulate this behaviour
2) It seems like ConnectionAudit::isDuplicate is not thread safe but may be 
called from different threads.
3) And I'm not sure that I understand correctly the purposes of isDuplicate. 
Could you please explain what is it used for and if it's configurable?

Best regards,
Lyuba

-----Original Message-----
From: Timothy Bish [mailto:tabish...@gmail.com]
Sent: Tuesday, July 01, 2014 12:20 AM
To: dev@activemq.apache.org
Subject: Re: [ActiveMQCPP 3.8.2|Linux] crash in 
activemq::core::ConnectionAudit::isDuplicate

On 06/29/2014 10:16 AM, Lyubov Romanchuk wrote:
Hi,
We use activemqcpp library from the version 3.8.2.
Sometimes there is a crash in activemq::core::ConnectionAudit::isDuplicate.
Could you please advise with this core - what may cause such crash, is it a 
known issue?

Here is the call stack from one of the cores:

* 1 Thread 32129  0x760417ab in 
decaf::lang::PointerComparator<activemq::commands::ActiveMQDestination, 
decaf::util::concurrent::atomic::AtomicRefCounter>::operator() (this=0x874ce1c, 
left=..., right=...) at decaf/lang/Pointer.h:243
(gdb) bt
#0  0x760417ab in 
decaf::lang::PointerComparator<activemq::commands::ActiveMQDestination, 
decaf::util::concurrent::atomic::AtomicRefCounter>::operator() (this=0x874ce1c, 
left=..., right=...) at decaf/lang/Pointer.h:243
#1  0x76108cad in std::_Rb_tree<decaf::lang::Pointer<activemq::commands::ActiveMQDestination, decaf::util::concurrent::atomic::AtomicRefCounter>, 
std::pair<decaf::lang::Pointer<activemq::commands::ActiveMQDestination, decaf::util::concurrent::atomic::AtomicRefCounter> const, 
decaf::lang::Pointer<activemq::core::ActiveMQMessageAudit, decaf::util::concurrent::atomic::AtomicRefCounter> >, 
std::_Select1st<std::pair<decaf::lang::Pointer<activemq::commands::ActiveMQDestination, decaf::util::concurrent::atomic::AtomicRefCounter> const, 
decaf::lang::Pointer<activemq::core::ActiveMQMessageAudit, decaf::util::concurrent::atomic::AtomicRefCounter> > >, 
decaf::lang::PointerComparator<activemq::commands::ActiveMQDestination, decaf::util::concurrent::atomic::AtomicRefCounter>, 
std::allocator<std::pair<decaf::lang::Pointer<activemq::commands::ActiveMQDestination, decaf::util::concurrent::atomic::AtomicRefCounter> const, 
decaf::lang::Pointer<activemq::core::ActiveMQMessageAudit, decaf::util::concurrent::atomic::AtomicRefCounter> > > >::find (this=0x874ce14, __k=...) 
at /packages/gnu-3.2.3-20.linux30/include/c++/3.2.3/bits/stl_tree.h:669
#2  0x76100316 in 
decaf::util::StlMap<decaf::lang::Pointer<activemq::commands::ActiveMQDestination, 
decaf::util::concurrent::atomic::AtomicRefCounter>, 
decaf::lang::Pointer<activemq::core::ActiveMQMessageAudit, 
decaf::util::concurrent::atomic::AtomicRefCounter>, 
decaf::lang::PointerComparator<activemq::commands::ActiveMQDestination, 
decaf::util::concurrent::atomic::AtomicRefCounter> >::containsKey (this=0x874ce10, key=...)
      at /packages/gnu-3.2.3-20.linux30/include/c++/3.2.3/bits/stl_map.h:345
#3  0x760fb57a in activemq::core::ConnectionAudit::isDuplicate (this=0x874cdf4, 
dispatcher=0xc0a7e94, message=...) at decaf/util/StlMap.h:794
#4  0x7603605c in activemq::core::ActiveMQConnection::isDuplicate 
(this=0x8a74408, dispatcher=0x32332d46, message=...) at 
decaf/util/concurrent/atomic/AtomicRefCounter.h:46
#5  0x76141bb5 in activemq::core::kernels::ActiveMQConsumerKernel::dispatch 
(this=0xc0a7e88, dispatch=...) at 
activemq/core/kernels/ActiveMQSessionKernel.h:330
#6  0x760e4b1b in activemq::core::ActiveMQSessionExecutor::dispatch 
(this=0x32332d46, dispatch=...) at decaf/lang/Pointer.h:258
#7  0x760e4e92 in activemq::core::ActiveMQSessionExecutor::iterate 
(this=0x5a5676a0) at activemq/core/ActiveMQSessionExecutor.cpp:181
#8  0x762659b6 in activemq::threads::DedicatedTaskRunner::run (this=0x5a6935e0) 
at activemq/threads/DedicatedTaskRunner.cpp:141
#9  0x7646285e in decaf::lang::Thread::run (this=0x32332d46) at 
decaf/lang/Thread.cpp:141
#10 0x76421c17 in (anonymous namespace)::runCallback (arg=0x5abb66e8) at 
decaf/internal/util/concurrent/Threading.cpp:266
#11 0x76421b89 in (anonymous namespace)::threadEntryMethod (arg=0x5abb66e8) at 
decaf/internal/util/concurrent/Threading.cpp:254
#12 0x757f145b in start_thread () from /lib/libpthread.so.0
#13 0x7566024e in clone () from /lib/libc.so.6
(gdb) t 10
[Switching to thread 10 (Thread 32093)]#0  0x756951b2 in dl_iterate_phdr () 
from /lib/libc.so.6
(gdb) bt
#0  0x756951b2 in dl_iterate_phdr () from /lib/libc.so.6
#1  0x0849cd55 in _Unwind_Find_FDE ()
#2  0x0849a815 in ?? ()
#3  0x0849b0a8 in _Unwind_RaiseException ()
#4  0x75762309 in __cxa_throw () from /usr/lib/libstdc++.so.5
#5  0x760a6bb8 in activemq::core::ActiveMQMessageAudit::isDuplicate 
(this=0xbbef390, msgId=...) at decaf/util/HashMap.h:971
#6  0x760faba1 in activemq::core::ConnectionAudit::isDuplicate (this=0x874cdf4, 
dispatcher=0x4ff9473c, message=...) at decaf/lang/Pointer.h:258
#7  0x7603605c in activemq::core::ActiveMQConnection::isDuplicate 
(this=0x8a74408, dispatcher=0xb726488, message=...) at 
decaf/util/concurrent/atomic/AtomicRefCounter.h:46
#8  0x76141bb5 in activemq::core::kernels::ActiveMQConsumerKernel::dispatch 
(this=0x4ff94730, dispatch=...) at 
activemq/core/kernels/ActiveMQSessionKernel.h:330
#9  0x760e4b1b in activemq::core::ActiveMQSessionExecutor::dispatch 
(this=0xb726488, dispatch=...) at decaf/lang/Pointer.h:258
#10 0x760e4e92 in activemq::core::ActiveMQSessionExecutor::iterate 
(this=0xb25f658) at activemq/core/ActiveMQSessionExecutor.cpp:181
#11 0x762659b6 in activemq::threads::DedicatedTaskRunner::run (this=0xc073290) 
at activemq/threads/DedicatedTaskRunner.cpp:141
#12 0x7646285e in decaf::lang::Thread::run (this=0xb726488) at 
decaf/lang/Thread.cpp:141
#13 0x76421c17 in (anonymous namespace)::runCallback (arg=0xb6ab2c8) at 
decaf/internal/util/concurrent/Threading.cpp:266
#14 0x76421b89 in (anonymous namespace)::threadEntryMethod (arg=0xb6ab2c8) at 
decaf/internal/util/concurrent/Threading.cpp:254
#15 0x757f145b in start_thread () from /lib/libpthread.so.0
#16 0x7566024e in clone () from /lib/libc.so.6

Best regards,
Lyuba

No know issue in this area.  A test case to reproduce would be helpful.

You can set connection.checkForDuplicates=false on the URI or call factory.setCheckForDuplicates(false) on your ActiveMQConnectionFactory instance to disable duplicate checking which should sort you out.

--
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.b...@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Reply via email to