activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject help needed: heap corruption when activemq-cpp routines called
Date Wed, 16 Jun 2010 09:08:41 GMT
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:

        new activemq::core::ActiveMQConnectionFactory(queueManagerName));

The variable 'queueManagerName' is initialised correctly, it is set 

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:

        [Frames below may be incorrect and/or missing, no symbols loaded 
for ntdll.dll] 
>       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 
        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

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.


Andrew Marlow

This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
delete this e-mail. Any unauthorised copying, disclosure or distribution of the material in
this e-mail is prohibited.

Please refer to
 for additional disclosures.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message