Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D624E105BE for ; Tue, 22 Oct 2013 15:01:56 +0000 (UTC) Received: (qmail 64207 invoked by uid 500); 22 Oct 2013 15:01:56 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 64170 invoked by uid 500); 22 Oct 2013 15:01:55 -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 64136 invoked by uid 99); 22 Oct 2013 15:01:54 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Oct 2013 15:01:54 +0000 Date: Tue, 22 Oct 2013 15:01:54 +0000 (UTC) From: =?utf-8?Q?Daniel_La=C3=BCgt_=28JIRA=29?= To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMQCPP-520) AMQ crashes when an exception comes during the connection closure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQCPP-520?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel La=C3=BCgt updated AMQCPP-520: -------------------------------- Attachment: test.cc > AMQ crashes when an exception comes during the connection closure > ----------------------------------------------------------------- > > Key: AMQCPP-520 > URL: https://issues.apache.org/jira/browse/AMQCPP-520 > Project: ActiveMQ C++ Client > Issue Type: Bug > Affects Versions: 3.6.0 > Environment: Solaris 10 with gcc 3.4.6 > Reporter: Daniel La=C3=BCgt > Assignee: Timothy Bish > Priority: Minor > Labels: AMQCPP-463, Regression, from > Attachments: FailoverTransport.cpp.patch, test.cc > > Original Estimate: 48h > Remaining Estimate: 48h > > From one thread, an exception comes and FailoverTransport::handleTranspor= tFailure () is called: > activemq::transport::failover::CloseTransportsTask::add(const Pointer transport) > activemq::transport::failover::FailoverTransport::handleTransportFailure(= const decaf::lang::Exception & error=3D{...}) > activemq::transport::failover::FailoverTransportListener::onException(con= st decaf::lang::Exception & ex=3D{...}) > activemq::transport::TransportFilter::onException(const decaf::lang::Exce= ption & ex=3D{...}) > activemq::wireformat::openwire::OpenWireFormatNegotiator::onException(con= st decaf::lang::Exception & ex=3D{...}) > activemq::transport::TransportFilter::onException(const decaf::lang::Exce= ption & ex=3D{...}) > activemq::transport::inactivity::InactivityMonitor::onException(const dec= af::lang::Exception & ex=3D{...}) > activemq::transport::TransportFilter::onException(const decaf::lang::Exce= ption & ex=3D{...}) > activemq::transport::IOTransport::fire(decaf::lang::Exception & ex=3D{...= }) > activemq::transport::IOTransport::run() > decaf::lang::Thread::run() > From another thread, the amq connection is being closed. It destructs the= FailoverTransport without waiting that the first thread finishes to call h= andleTransportFailure(): > activemq::transport::failover::FailoverTransport::~FailoverTransport() > activemq::transport::failover::FailoverTransport::`vector deleting destru= ctor'(unsigned int) > decaf::lang::Pointer::onDeleteFunc(activemq::transport::Transport = * value=3D0x02f307b0) > decaf::lang::Pointer::~Pointer() > decaf::lang::Pointer::reset(activemq::transport::Transport * value= =3D0x00000000) > activemq::transport::TransportFilter::~TransportFilter() > activemq::transport::correlator::ResponseCorrelator::~ResponseCorrelator(= ) > activemq::transport::correlator::ResponseCorrelator::`vector deleting des= tructor'(unsigned int) > decaf::lang::Pointer::onDeleteFunc(activemq::transport::Transport = * value=3D0x03ba6058) > decaf::lang::Pointer::~Pointer() > decaf::lang::Pointer::reset(activemq::transport::Transport * value= =3D0x00000000) > activemq::core::ActiveMQConnection::disconnect(__int64 lastDeliveredSeque= nceId=3D0) > activemq::core::ActiveMQConnection::close() > I don't have any simple test case as it is a race condition. > I've attached a proposal patch. -- This message was sent by Atlassian JIRA (v6.1#6144)