Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 147 invoked from network); 6 Jun 2007 12:56:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jun 2007 12:56:55 -0000 Received: (qmail 19042 invoked by uid 500); 6 Jun 2007 12:56:59 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 19017 invoked by uid 500); 6 Jun 2007 12:56:59 -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 19007 invoked by uid 99); 6 Jun 2007 12:56:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 05:56:59 -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; Wed, 06 Jun 2007 05:56:54 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1756E71418F for ; Wed, 6 Jun 2007 05:56:34 -0700 (PDT) Message-ID: <5218769.1181134594088.JavaMail.jira@brutus> Date: Wed, 6 Jun 2007 05:56:34 -0700 (PDT) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQCPP-122) Crash on Windows when rapidly creating and destroying connections In-Reply-To: <22738382.1180908572868.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQCPP-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39228 ] Timothy Bish commented on AMQCPP-122: ------------------------------------- Definitely seems like it. I've reproduced it on my windows machine, can't seem to on Linux. It seems like it has something to do with the timing of breaking the socket connection in the TcpTransport and what state the StompCommandReader was in at the time. > Crash on Windows when rapidly creating and destroying connections > ----------------------------------------------------------------- > > Key: AMQCPP-122 > URL: https://issues.apache.org/activemq/browse/AMQCPP-122 > Project: ActiveMQ C++ Client > Issue Type: Bug > Affects Versions: 2.1 > Reporter: Albert Strasheim > Assignee: Nathan Mittler > Fix For: 2.1 > > > Me again. :) > The following program crashes within a few seconds on my Windows XP machine. This machine has a Core 2 Duo processor (i. e. 2 cores). > On my Pentium 4 + Hyperthreading Linux machine is only dies after about a minute with: > terminate called after throwing an instance of 'activemq::exceptions::ActiveMQException' > what(): Cannot assign requested address > Aborted > However, this is to be expected, since the program causes thousands of sockets to be created. This doesn't seem to be the reason it crashes on Windows though. > The code: > {code:none} > #include > #include > #include > #include > #include > int main(int argc, char* argv[]) { > activemq::core::ActiveMQConnectionFactory connectionFactory("tcp://localhost:61613?wireFormat=stomp"); > while(true) > { > cms::Connection* connection = connectionFactory.createConnection(); > cms::Session* session = connection->createSession(cms::Session::AUTO_ACKNOWLEDGE); > cms::Topic* topic = session->createTopic("topic"); > cms::MessageProducer* producer = session->createProducer(topic); > delete producer; > delete topic; > delete session; > delete connection; > } > return 0; > } > {code} > The stack trace when it crashes: > > activemq-cppd.dll!activemq::io::BufferedInputStream::read() Line 79 + 0x12 bytes C++ > activemq-cppd.dll!activemq::connector::stomp::StompCommandReader::readStompHeaderLine() Line 194 + 0x19 bytes C++ > activemq-cppd.dll!activemq::connector::stomp::StompCommandReader::readStompCommandHeader(activemq::connector::stomp::StompFrame & frame={...}) Line 101 C++ > activemq-cppd.dll!activemq::connector::stomp::StompCommandReader::readCommand() Line 59 C++ > activemq-cppd.dll!activemq::transport::IOTransport::run() Line 166 + 0x19 bytes C++ > activemq-cppd.dll!activemq::concurrent::Thread::runCallback(void * param=0x003ad328) Line 152 + 0x13 bytes C++ > msvcr80d.dll!_callthreadstartex() Line 348 + 0xf bytes C > msvcr80d.dll!_threadstartex(void * ptd=0x003adac0) Line 331 C > kernel32.dll!7c80b683() > [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll] > The line in BufferedInputStream::read is: > char returnValue = buffer[head++]; > There is a local variable called bufferSize with a value of 1024. However, the value of head is usually much larger than bufferSize (like more than 10000). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.