Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 54509 invoked from network); 12 Jun 2007 14:29:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jun 2007 14:29:00 -0000 Received: (qmail 72564 invoked by uid 500); 12 Jun 2007 14:28:58 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 72529 invoked by uid 500); 12 Jun 2007 14:28:58 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 72497 invoked by uid 99); 12 Jun 2007 14:28:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 07:28:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 07:28:53 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 321BD7141FB for ; Tue, 12 Jun 2007 07:28:33 -0700 (PDT) Message-ID: <12527423.1181658513201.JavaMail.jira@brutus> Date: Tue, 12 Jun 2007 07:28:33 -0700 (PDT) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQCPP-126) closing ressources after an IOException crashes the app In-Reply-To: <30614333.1181657552830.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQCPP-126?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Timothy Bish updated AMQCPP-126: -------------------------------- Fix Version/s: 2.1 > closing ressources after an IOException crashes the app > ------------------------------------------------------- > > Key: AMQCPP-126 > URL: https://issues.apache.org/activemq/browse/AMQCPP-126 > Project: ActiveMQ C++ Client > Issue Type: Bug > Components: CMS Impl > Affects Versions: 2.0.1 > Environment: tested on Windows 2000 > Reporter: olivier renaud > Assignee: Nathan Mittler > Fix For: 2.1 > > > When a network error occurs, I want to clean up all the created objects a= nd close the connection and the session. > So, when I catch an exception (activemq::io::IOException), either created= by from producer.send, or by an asynchronous notification on the Exception= Listener object set for the Connection. > However, closing ressources (Consumer, Producer, or Session) always crash= the application. This can be seen with the Example code in ActiveMQCPP sou= rces : > - run the example program so that it connects to a distant host (not loca= lhost) > - physically unplug the network (or shutdown the network connection), and= wait > The program stops with the following message : > {quote} > ... > Sent message #334 from thread 1216 > Sent message #335 from thread 1216 > Message #335 Received: Hello world! from thread 1216 > JMS Exception occured. Shutting down client. > response from futureResponse was invalid > FILE: ..\src\main\activemq\transport\ResponseCorrelator.cpp, LINE= : 145 > FILE: ..\src\main\activemq\transport\ResponseCorrelator.cpp, LINE= : 152 > FILE: ..\src\main\activemq\connector\openwire\OpenWireFormatNegot= iator.c > pp, LINE: 105 > FILE: ..\src\main\activemq\connector\openwire\OpenWireConnector.c= pp, LIN > E: 1468 > FILE: ..\src\main\activemq\connector\openwire\OpenWireConnector.c= pp, LIN > E: 928 > FILE: ..\src\main\activemq\core\ActiveMQSession.cpp, LINE: 703 > FILE: ..\src\main\activemq\core\ActiveMQProducer.cpp, LINE: 194 > FILE: ..\src\main\activemq\core\ActiveMQProducer.cpp, LINE: 149 > FILE: ..\src\main\activemq\core\ActiveMQProducer.cpp, LINE: 108 > ----------------------------------------------------- > Finished with the example, ignore errors from this > point on as the sockets breaks when we shutdown. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > {quote} > And it generates an access violation, with the following stack trace : > {quote} > =09NTDLL.DLL!784905a5() =09 > =09[Les frames ci-dessous sont peut-=EAtre incorrects et/ou manquants, a= ucun symbole charg=E9 pour NTDLL.DLL]=09 > =09NTDLL.DLL!7847bd5a() =09 > =09NTDLL.DLL!7847bf68() =09 > =09NTDLL.DLL!7847bf98() =09 > =09NTDLL.DLL!784ab63e() =09 > =09NTDLL.DLL!7847bf68() =09 > =09NTDLL.DLL!7847bf98() =09 > =09NTDLL.DLL!7847c1ea() =09 > =09msvcr80d.dll!1024db9c() =09 > =09msvcr80d.dll!1020faa5() =09 > =09msvcr80d.dll!1020f839() =09 > =09msvcr80d.dll!1020f7b9() =09 > =09msvcr80d.dll!1026902f() =09 > >=09vs2005-activemq-example.exe!std::_Iterator_base::_Adopt(const std::_C= ontainer_base * _Parent=3D0x00033540) Ligne 166=09C++ > =09vs2005-activemq-example.exe!std::_Vector_const_iterator >::_Vector_const_iterator >(unsigned char * _Ptr=3D0x00cb5f21, const std::_= Container_base * _Pvector=3D0x00033540) Ligne 73=09C++ > =09vs2005-activemq-example.exe!std::_Vector_iterator >::_Vector_iterator >(unsigned char * _Ptr=3D0x00000009, const std::_Container_ba= se * _Pvector=3D0x000336dc) Ligne 309=09C++ > =0900cb5f18()=09 > =09vs2005-activemq-example.exe!std::vector >::push_back(const unsigned char & _Val=3D0) Ligne 800 + 0x= 24 octets=09C++ > =09vs2005-activemq-example.exe!activemq::io::ByteArrayOutputStream::writ= e(unsigned char c=3D0) Ligne 54=09C++ > =09vs2005-activemq-example.exe!activemq::io::DataOutputStream::write(con= st unsigned char c=3D0) Ligne 43=09C++ > =09vs2005-activemq-example.exe!activemq::io::DataOutputStream::writeUnsi= gnedShort(unsigned short value=3D36) Ligne 126=09C++ > =09vs2005-activemq-example.exe!activemq::io::DataOutputStream::writeUTF(= const std::basic_string,std::allocator > = & value=3D"4bf52ac5-df69-4b18-b28d-669a36b2b7f9") Ligne 217=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::marshal::B= aseDataStreamMarshaller::looseMarshalString(std::basic_string,std::allocator > value=3D"4bf52ac5-df69-4b18-b28d-669a= 36b2b7f9", activemq::io::DataOutputStream * dataOut=3D0x00cb5df8) Ligne 30= 7=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::marshal::v= 2::ConsumerIdMarshaller::looseMarshal(activemq::connector::openwire::OpenWi= reFormat * wireFormat=3D0x0031e150, activemq::connector::openwire::commands= ::DataStructure * dataStructure=3D0x00cb6288, activemq::io::DataOutputStrea= m * dataOut=3D0x00cb5df8) Ligne 131=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireFo= rmat::looseMarshalNestedObject(activemq::connector::openwire::commands::Dat= aStructure * o=3D0x00cb6288, activemq::io::DataOutputStream * dataOut=3D0x0= 0cb5df8) Ligne 458=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::marshal::B= aseDataStreamMarshaller::looseMarshalCachedObject(activemq::connector::open= wire::OpenWireFormat * wireFormat=3D0x0031e150, activemq::connector::openwi= re::commands::DataStructure * data=3D0x00cb6288, activemq::io::DataOutputSt= ream * dataOut=3D0x00cb5df8) Ligne 98 + 0x10 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::marshal::v= 2::RemoveInfoMarshaller::looseMarshal(activemq::connector::openwire::OpenWi= reFormat * wireFormat=3D0x0031e150, activemq::connector::openwire::commands= ::DataStructure * dataStructure=3D0x00034e7c, activemq::io::DataOutputStrea= m * dataOut=3D0x00cb5df8) Ligne 124 + 0x35 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireFo= rmat::marshal(activemq::transport::Command * command=3D0x00034e78, activemq= ::io::DataOutputStream * dataOut=3D0x0031fd98) Ligne 153=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= mmandWriter::writeCommand(activemq::transport::Command * command=3D0x00034e= 78) Ligne 72=09C++ > =09vs2005-activemq-example.exe!activemq::transport::IOTransport::oneway(= activemq::transport::Command * command=3D0x00034e78) Ligne 83 + 0x1d octet= s=09C++ > =09vs2005-activemq-example.exe!activemq::transport::TransportFilter::one= way(activemq::transport::Command * command=3D0x00034e78) Ligne 147=09C++ > =09vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::= oneway(activemq::transport::Command * command=3D0x00034e78) Ligne 87 + 0x1= d octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireFo= rmatNegotiator::oneway(activemq::transport::Command * command=3D0x00034e78)= Ligne 73 + 0x1d octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::oneway(activemq::transport::Command * command=3D0x00034e78) Ligne= 1436 + 0x1d octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::disposeOf(activemq::connector::openwire::commands::DataStructure *= objectId=3D0x00c91b40) Ligne 1483=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::closeResource(activemq::connector::ConnectorResource * resource=3D= 0x00c919b8) Ligne 1315 + 0xf octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::BaseConnectorResourc= e::close() Ligne 60=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::~OpenWireConsumerInfo() Ligne 53=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::`scalar deleting destructor'() + 0xf octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::closeResource(activemq::connector::ConnectorResource * resource=3D= 0x00c919b8) Ligne 1318 + 0x32 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::BaseConnectorResourc= e::close() Ligne 60=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::~OpenWireConsumerInfo() Ligne 53=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::`scalar deleting destructor'() + 0xf octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::closeResource(activemq::connector::ConnectorResource * resource=3D= 0x00c919b8) Ligne 1318 + 0x32 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::BaseConnectorResourc= e::close() Ligne 60=09C++ > =09... > =09[ here, the same message repeated about 50 times ] > =09... > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::~OpenWireConsumerInfo() Ligne 53=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::`scalar deleting destructor'() + 0xf octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::closeResource(activemq::connector::ConnectorResource * resource=3D= 0x00c919b8) Ligne 1318 + 0x32 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::BaseConnectorResourc= e::close() Ligne 60=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::~OpenWireConsumerInfo() Ligne 53=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::`scalar deleting destructor'() + 0xf octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::closeResource(activemq::connector::ConnectorResource * resource=3D= 0x00c919b8) Ligne 1318 + 0x32 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::BaseConnectorResourc= e::close() Ligne 60=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::~OpenWireConsumerInfo() Ligne 53=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::`scalar deleting destructor'() + 0xf octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::closeResource(activemq::connector::ConnectorResource * resource=3D= 0x00c919b8) Ligne 1318 + 0x32 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::BaseConnectorResourc= e::close() Ligne 60=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::~OpenWireConsumerInfo() Ligne 53=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nsumerInfo::`scalar deleting destructor'() + 0xf octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::openwire::OpenWireCo= nnector::closeResource(activemq::connector::ConnectorResource * resource=3D= 0x00c919b8) Ligne 1318 + 0x32 octets=09C++ > =09vs2005-activemq-example.exe!activemq::connector::BaseConnectorResourc= e::close() Ligne 60=09C++ > =09vs2005-activemq-example.exe!activemq::core::ActiveMQConsumer::close()= Ligne 87 + 0x19 octets=09C++ > =09vs2005-activemq-example.exe!activemq::core::ActiveMQConsumer::~Active= MQConsumer() Ligne 64=09C++ > =09vs2005-activemq-example.exe!activemq::core::ActiveMQConsumer::`scalar= deleting destructor'() + 0xf octets=09C++ > =09vs2005-activemq-example.exe!HelloWorldConsumer::cleanup() Ligne 269 = + 0x40 octets=09C++ > =09vs2005-activemq-example.exe!HelloWorldConsumer::~HelloWorldConsumer()= Ligne 180=09C++ > =09vs2005-activemq-example.exe!main(int argc=3D1, char * * argv=3D0x0031= 5b30) Ligne 340 + 0x2d octets=09C++ > =09vs2005-activemq-example.exe!__tmainCRTStartup() Ligne 586 + 0x19 oct= ets=09C > =09vs2005-activemq-example.exe!mainCRTStartup() Ligne 403=09C > =09KERNEL32.DLL!77e98989() =09 > =09NTDLL.DLL!78465c09() =09 > {quote} > I see no way of properly closing ressources when a disconnection happen --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.