Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 71726 invoked from network); 16 Jun 2010 12:14:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Jun 2010 12:14:39 -0000 Received: (qmail 57130 invoked by uid 500); 16 Jun 2010 12:14:39 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 56763 invoked by uid 500); 16 Jun 2010 12:14:36 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 56755 invoked by uid 99); 16 Jun 2010 12:14:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jun 2010 12:14:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=AWL,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tabish121@gmail.com designates 74.125.83.43 as permitted sender) Received: from [74.125.83.43] (HELO mail-gw0-f43.google.com) (74.125.83.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jun 2010 12:14:30 +0000 Received: by gwaa12 with SMTP id a12so7249984gwa.2 for ; Wed, 16 Jun 2010 05:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=pJ5xS8SN6PQX8nKFdTgzuR2yZOhTlTHNOgEtKE7RVfM=; b=aWV2lpFv88sLbfqhxlmGKP5Y+oDlo2JbIPYiCldSqG3ItLjAVQRHnc4/+Twp3YK9/F cIogj0llclWLC47gsNl1gkCL/vL6Kjuh0pCCf9q1Nq1InWHM+D43i9zYwiMFZVtd2IMt fFRYDkgG2Xhstuteq1Ds18DvZwENtgXAvESvg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=ncfE3WfOQKdR4MvN4W/fZc5XAvNXonHj5qXjXYrG9Ams3XtrAwvZ8TufuYRyqqf3vw X9l8kS9f6nQH5q5lv+WtV1vjAlx8NfV56MuIXnqIUmgl0eBSCI7C3LzZWEQbm251MVa3 ygBOwcXAGJD1jVpZVQGGwctLMozYK9+WSMQXs= Received: by 10.229.213.199 with SMTP id gx7mr3840488qcb.187.1276690449552; Wed, 16 Jun 2010 05:14:09 -0700 (PDT) Received: from [192.168.2.150] (c-76-21-195-19.hsd1.va.comcast.net [76.21.195.19]) by mx.google.com with ESMTPS id e1sm7359021vch.41.2010.06.16.05.14.07 (version=SSLv3 cipher=RC4-MD5); Wed, 16 Jun 2010 05:14:08 -0700 (PDT) Subject: Re: help needed: heap corruption when activemq-cpp routines called From: Timothy Bish To: users@activemq.apache.org In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Wed, 16 Jun 2010 08:14:06 -0400 Message-ID: <1276690446.2562.1.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit On Wed, 2010-06-16 at 10:08 +0100, andrew.marlow@uk.bnpparibas.com wrote: > I have been seeing an intermittent heap corruption in my AMQ-cpp program, > on and of, for some time now. It happens right at the start when it calls > activemq::library::ActiveMQCPP::initializeLibrary(). Unfortunately, that > which was intermittent is now happening every time. > > I am using AMQ-cpp 3.1.0 in Windows-XP SP3, with VS 2005 (aka vc8). > > By moving this call to at the very start of main, the bug relocates -- it > then fails on this line of code: > > std::auto_ptr > connectionFactory( > new activemq::core::ActiveMQConnectionFactory(queueManagerName)); > > The variable 'queueManagerName' is initialised correctly, it is set > to"tcp://127.0.0.1:61616". > > Output from VS is not very helpful: > > First-chance exception at 0x7c919084 in myprog.exe: 0xC0000005: Access > violation reading location 0x0000000f. > First-chance exception at 0x7c812afb in myprog.exe: Microsoft C++ > exception: std::bad_alloc at memory location 0x0012ee7c.. > HEAP[myprog.exe]: Heap block at 0541A820 modified at 0541A864 past > requested size of 3c > > I have tried using DUMA, a memory debugger, to shed any light but > unfortunately, it yields nothing. Sadly, I do not have access to purify. > Also the code is non-portable (don't ask) so I can't build it on linux and > use valgrind. > > The call stack looks like this: > > ntdll.dll!7c90120e() > [Frames below may be incorrect and/or missing, no symbols loaded > for ntdll.dll] > ntdll.dll!7c96e139() > ntdll.dll!7c95f38c() > ntdll.dll!7c96e507() > ntdll.dll!7c9622e8() > ntdll.dll!7c90327a() > kernel32.dll!7c85f9a7() > > msvcr80d.dll!_CrtIsValidHeapPointer(const void * > pUserData=0x0541a848) Line 2072 C++ > msvcr80d.dll!_free_dbg_nolock(void * pUserData=0x0541a848, int > nBlockUse=1) Line 1279 + 0x9 bytes C++ > msvcr80d.dll!_free_dbg(void * pUserData=0x0541a848, int > nBlockUse=1) Line 1220 + 0xd bytes C++ > msvcr80d.dll!operator delete(void * pUserData=0x0541a848) Line 54 > + 0x10 bytes C++ > myprog.exe!xms::ConnectionFactory::setProperty() + 0x78e bytes > C++ > myprog.exe!main(int argc=11, char * * argv=0x054172b0) Line 457 + > 0x10 bytes C++ > myprog.exe!__tmainCRTStartup() Line 597 + 0x19 bytes C > myprog.exe!mainCRTStartup() Line 414 C > kernel32.dll!7c817077() > > This is weird because I do not call ConnectionFactory::setProperty(), and > the only call I make to AMQ-cpp from main is the init call. > > The problem does not occur in Release mode. Unfortunately I need Debug > mode (for various reasons). > > Recently a bug was reported in AMQ-cpp to do with deadlocks that bites > Windows users. I am on the version that has that bug but I do not think > that bug is responsible for this. > > I am desperately in need of some help/guidance please. Can you provide a sample app that demonstrates the issue? I've not see this error before. Regards -- Tim Bish Open Source Integration: http://fusesource.com ActiveMQ in Action: http://www.manning.com/snyder/ Follow me on Twitter: http://twitter.com/tabish121 My Blog: http://timbish.blogspot.com/