Hi http://www.nabble.com/file/p25110969/producer.cpp 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 crashes. 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/libc.so.6 #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 decaf/net/SocketOutputStream.cpp:96 #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 decaf/io/BufferedOutputStream.cpp:113 #6 0x00801e90 in decaf::io::FilterOutputStream::flush (this=0x8c0fca8) at ./decaf/io/FilterOutputStream.h:189 #7 0x008327df in activemq::transport::IOTransport::oneway (this=0x8c0efa0, comma...@0xbf8fe144) at activemq/transport/IOTransport.cpp:131 #8 0x00833e00 in activemq::transport::TransportFilter::oneway (this=0x8c0eff8, comma...@0xbf8fe144) at ./activemq/transport/TransportFilter.h:129 #9 0x0087fde8 in activemq::wireformat::openwire::OpenWireFormatNegotiator::oneway (this=0x8c0fd58, comma...@0xbf8fe144) at activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp:76 #10 0x00837195 in activemq::transport::correlator::ResponseCorrelator::oneway (this=0x8c0feb8, comma...@0xbf8fe144) 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 activemq/core/ActiveMQConnection.cpp:547 #12 0x007bde96 in activemq::core::ActiveMQConnection::disposeOf (this=0x8c0ff90, object...@0xbf8fe1d0) at activemq/core/ActiveMQConnection.cpp:597 #13 0x007ebbc9 in activemq::core::ActiveMQSession::close (this=0x8c3cb68) at activemq/core/ActiveMQSession.cpp:155 #14 0x0804975d in HelloWorldProducer::cleanup () #15 0x08049ce1 in HelloWorldProducer::run () #16 0x080491a8 in main () thanks in advance Abhi -- View this message in context: http://www.nabble.com/ActiveMQ-CPP----client-crashes-during-cleanup-tp25110969p25110969.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.