activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From A_MAJUM <>
Subject ActiveMQ CPP -- client crashes during cleanup
Date Mon, 24 Aug 2009 06:07:51 GMT

Hi producer.cpp 

I am trying to use ActiveMQ-CPP in my application. Everything went fine ---
but all the hell broke loose when I restarted the ActiveMQ broker. When the
broker is stopped my onException function is invoked. I set a flag there and
in a different function I close the connection and session objects. It looks
like ultimately closing a session or connection will try to flush the socket
output stream --- this gives rise to broken pipe error and my application

Please help me!! I cannot proceed without fixing this issue as it makes our
product extremely unreliable. If there is any work-around, please let me
know. I went through the forum found some similar issues, but not exactly
like my case. Those issues are old too.

Note that I can reproduce this issue EVERY SINGLE TIME. 

I am attaching a small program to reproduce it. I cut down the chat example
to the bare minimum and tried to recreate the issue in cleanup(). After
starting the program I stopped the broker. Although no broken pipe is
displayed on the screen it stopped suddenly without going through the entire
cleanup() function. The gdb shows there is a broken pipe problem (trace is
given below).

I am using --

1. activemq 5.20
2. activemq-CPP 3.0.1
3. apr 1.3.5
4. apr-util 1.3.8
5. Fedora core 9

The backtrace of gdb ---

#0  0x00110416 in __kernel_vsyscall ()
#1  0x0024b00b in write () from /lib/
#2  0x0012a1e8 in apr_socket_send (sock=0x8c16620, buf=0x8c0f830 "",
len=0xbf8fde84) at network_io/unix/sendrecv.c:41
#3  0x009b26b0 in decaf::net::SocketOutputStream::write (this=0x8c0f130,
buffer=0x8c0f830 "", offset=0, len=50) at
#4  0x0099747b in decaf::io::BufferedOutputStream::emptyBuffer
(this=0x8c0f778) at decaf/io/BufferedOutputStream.cpp:96
#5  0x00997b7d in decaf::io::BufferedOutputStream::flush (this=0x8c0f778) at
#6  0x00801e90 in decaf::io::FilterOutputStream::flush (this=0x8c0fca8) at
#7  0x008327df in activemq::transport::IOTransport::oneway (this=0x8c0efa0,
command=@0xbf8fe144) at activemq/transport/IOTransport.cpp:131
#8  0x00833e00 in activemq::transport::TransportFilter::oneway
(this=0x8c0eff8, command=@0xbf8fe144) at
#9  0x0087fde8 in
(this=0x8c0fd58, command=@0xbf8fe144)
    at activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp:76
#10 0x00837195 in
activemq::transport::correlator::ResponseCorrelator::oneway (this=0x8c0feb8,
    at activemq/transport/correlator/ResponseCorrelator.cpp:58
#11 0x007bc657 in activemq::core::ActiveMQConnection::oneway
(this=0x8c0ff90, command=
      {<decaf::lang::AtomicRefCounter> = {counter = 0xbf8fe138},
_vptr.Pointer = 0xbf8fe144, value = 0x13354a}) at
#12 0x007bde96 in activemq::core::ActiveMQConnection::disposeOf
(this=0x8c0ff90, objectId=@0xbf8fe1d0) at
#13 0x007ebbc9 in activemq::core::ActiveMQSession::close (this=0x8c3cb68) at
#14 0x0804975d in HelloWorldProducer::cleanup ()
#15 0x08049ce1 in HelloWorldProducer::run ()
#16 0x080491a8 in main ()

thanks in advance

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message