You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jeffrey <je...@hotmail.com> on 2013/02/01 20:11:29 UTC

What is the purpose of the countdownlatch? and a crash of my receiver

I have a receiver class, but I never used the countdownlatch objects that are
listed in this example program.  http://activemq.apache.org/cms/example.html 
Im wondering what the latch actually does and how will not using it affect
my program.  Since upgrading to 3.5.0 my receiver now core dumps after the
return line at the end of my program. 

#0  0x60000000d341e6a0:1 in apr_pvsprintf () at memory/unix/apr_pools.c:1176
#1  0x60000000e2906ed0:0 in decaf::lang::Exception::buildMessage (
    this=0x2000000040089370, 
    format=0x60000000e1005530 "Failed to Lock OS Mutex", vargs=@0x7fffef00)
    at decaf/lang/Exception.cpp:124
#2  0x60000000e299b5b0:0 in
decaf::lang::exceptions::RuntimeException::RuntimeException
(this=0x2000000040089370, 
    file=0x60000000e10054c0
"decaf/internal/util/concurrent/unix/PlatformThread.cpp", lineNumber=77,
msg=0x60000000e1005530 "Failed to Lock OS Mutex")
    at decaf/lang/exceptions/RuntimeException.cpp:51
#3  0x60000000e2878160:0 in
decaf::internal::util::concurrent::PlatformThread::lockMutex (mutex=0x0)
    at decaf/internal/util/concurrent/unix/PlatformThread.cpp:76
#4  0x60000000e286a5b0:0 in
decaf::internal::util::concurrent::Threading::attachToCurrentThread () at
decaf/internal/util/concurrent/Threading.cpp:927
#5  0x60000000e2863350:0 in
decaf::internal::util::concurrent::Threading::getCurrentThreadHandle () at
decaf/internal/util/concurrent/Threading.cpp:1273
#6  0x60000000e2867a40:0 in
decaf::internal::util::concurrent::Threading::join
    (thread=0x2000000040092110, mills=0, nanos=0)
    at decaf/internal/util/concurrent/Threading.cpp:1069
#7  0x60000000e2869af0:0 in
decaf::internal::util::concurrent::Threading::destroyThread
(thread=0x2000000040092110)
    at decaf/internal/util/concurrent/Threading.cpp:893
#8  0x60000000e2985300:0 in decaf::lang::Thread::~Thread (
    this=0x200000007fffeff0, _noname=0) at decaf/lang/Thread.cpp:130
#9  0x400bc90:0 in main () at cleanamqsms.cpp:373

It goes to delete the thread started for the listener and crashes along the
way, but this does not happen on my sender class that invokes a thread in
the exact same manor.  Im wondering if that latch has anything to do with it
and also why it only started in 3.5.0 and did not happen in 3.4.5.  I
already have this fix in my library
https://issues.apache.org/jira/browse/AMQCPP-449.

Thanks in advance.



--
View this message in context: http://activemq.2283324.n4.nabble.com/What-is-the-purpose-of-the-countdownlatch-and-a-crash-of-my-receiver-tp4662651.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: What is the purpose of the countdownlatch? and a crash of my receiver

Posted by jeffrey <je...@hotmail.com>.
jire created 
https://issues.apache.org/jira/browse/AMQCPP-452



--
View this message in context: http://activemq.2283324.n4.nabble.com/What-is-the-purpose-of-the-countdownlatch-and-a-crash-of-my-receiver-tp4662651p4662733.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: What is the purpose of the countdownlatch? and a crash of my receiver

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2013-02-01 at 13:20 -0800, jeffrey wrote:
> The program is broken down to simply 
> 
> activemq::library::ActiveMQCPP::initializeLibrary();
> HBconsumer *hbc = new HBconsumer(brokerURI, destURI, 3);  //This is my
> receiver class it                               implements public
> ExceptionListener, public MessageListener, public Runnable
> Thread HBthread(hbc); //
> HBthread.start();  //     If I take out these three lines and do not create
> a thread, my program does                       nothing, but does not crash
> when exiting
> HBthread.join();  // 
> sleep(3); //
> delete hbc;
> activemq::library::ActiveMQCPP::shutdownLibrary(); // If I take out this
> line and leave in the others, then it works fine
> return 0;
> 
> I am still on HPUX11.31 btw, Ill get more information when I have time
> 

Please create a new Jira and attach a complete source sample that
demonstrates the issue otherwise I can't test it.



> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/What-is-the-purpose-of-the-countdownlatch-and-a-crash-of-my-receiver-tp4662651p4662660.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

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



Re: What is the purpose of the countdownlatch? and a crash of my receiver

Posted by jeffrey <je...@hotmail.com>.
The program is broken down to simply 

activemq::library::ActiveMQCPP::initializeLibrary();
HBconsumer *hbc = new HBconsumer(brokerURI, destURI, 3);  //This is my
receiver class it                               implements public
ExceptionListener, public MessageListener, public Runnable
Thread HBthread(hbc); //
HBthread.start();  //     If I take out these three lines and do not create
a thread, my program does                       nothing, but does not crash
when exiting
HBthread.join();  // 
sleep(3); //
delete hbc;
activemq::library::ActiveMQCPP::shutdownLibrary(); // If I take out this
line and leave in the others, then it works fine
return 0;

I am still on HPUX11.31 btw, Ill get more information when I have time



--
View this message in context: http://activemq.2283324.n4.nabble.com/What-is-the-purpose-of-the-countdownlatch-and-a-crash-of-my-receiver-tp4662651p4662660.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: What is the purpose of the countdownlatch? and a crash of my receiver

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2013-02-01 at 11:11 -0800, jeffrey wrote:
> I have a receiver class, but I never used the countdownlatch objects that are
> listed in this example program.  http://activemq.apache.org/cms/example.html 
> Im wondering what the latch actually does and how will not using it affect
> my program.  Since upgrading to 3.5.0 my receiver now core dumps after the
> return line at the end of my program. 

It does what its named for, its provides a latch that will wait until
its count hits zero.  

Not sure what's going on, recommend that you provide the code that
causes the error.  

> 
> #0  0x60000000d341e6a0:1 in apr_pvsprintf () at memory/unix/apr_pools.c:1176
> #1  0x60000000e2906ed0:0 in decaf::lang::Exception::buildMessage (
>     this=0x2000000040089370, 
>     format=0x60000000e1005530 "Failed to Lock OS Mutex", vargs=@0x7fffef00)
>     at decaf/lang/Exception.cpp:124
> #2  0x60000000e299b5b0:0 in
> decaf::lang::exceptions::RuntimeException::RuntimeException
> (this=0x2000000040089370, 
>     file=0x60000000e10054c0
> "decaf/internal/util/concurrent/unix/PlatformThread.cpp", lineNumber=77,
> msg=0x60000000e1005530 "Failed to Lock OS Mutex")
>     at decaf/lang/exceptions/RuntimeException.cpp:51
> #3  0x60000000e2878160:0 in
> decaf::internal::util::concurrent::PlatformThread::lockMutex (mutex=0x0)
>     at decaf/internal/util/concurrent/unix/PlatformThread.cpp:76
> #4  0x60000000e286a5b0:0 in
> decaf::internal::util::concurrent::Threading::attachToCurrentThread () at
> decaf/internal/util/concurrent/Threading.cpp:927
> #5  0x60000000e2863350:0 in
> decaf::internal::util::concurrent::Threading::getCurrentThreadHandle () at
> decaf/internal/util/concurrent/Threading.cpp:1273
> #6  0x60000000e2867a40:0 in
> decaf::internal::util::concurrent::Threading::join
>     (thread=0x2000000040092110, mills=0, nanos=0)
>     at decaf/internal/util/concurrent/Threading.cpp:1069
> #7  0x60000000e2869af0:0 in
> decaf::internal::util::concurrent::Threading::destroyThread
> (thread=0x2000000040092110)
>     at decaf/internal/util/concurrent/Threading.cpp:893
> #8  0x60000000e2985300:0 in decaf::lang::Thread::~Thread (
>     this=0x200000007fffeff0, _noname=0) at decaf/lang/Thread.cpp:130
> #9  0x400bc90:0 in main () at cleanamqsms.cpp:373
> 
> It goes to delete the thread started for the listener and crashes along the
> way, but this does not happen on my sender class that invokes a thread in
> the exact same manor.  Im wondering if that latch has anything to do with it
> and also why it only started in 3.5.0 and did not happen in 3.4.5.  I
> already have this fix in my library
> https://issues.apache.org/jira/browse/AMQCPP-449.
> 
> Thanks in advance.
> 
> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/What-is-the-purpose-of-the-countdownlatch-and-a-crash-of-my-receiver-tp4662651.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

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