activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Strasheim (JIRA)" <>
Subject [jira] Commented: (AMQCPP-118) Provide a way to allocate and free with the same allocator
Date Wed, 30 May 2007 15:37:33 GMT


Albert Strasheim commented on AMQCPP-118:

Actually looking at where this crashes turns up something interesting. The stack looks like

[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]	
vs2005-activemq-example.exe!_CrtIsValidHeapPointer(const void * pUserData=0x00c1af70)  Line
2072	C++
vs2005-activemq-example.exe!_free_dbg_nolock(void * pUserData=0x00c1af70, int nBlockUse=1)
 Line 1279 + 0x9 bytes	C++
vs2005-activemq-example.exe!_free_dbg(void * pUserData=0x00c1af70, int nBlockUse=1)  Line
1220 + 0xd bytes	C++
vs2005-activemq-example.exe!operator delete(void * pUserData=0x00c1af70)  Line 54 + 0x10 bytes
vs2005-activemq-example.exe!std::allocator<char>::deallocate(char * _Ptr=0x00c1af70,
unsigned int __formal=32)  Line 141 + 0x9 bytes	C++
>::_Tidy(bool _Built=true, unsigned int _Newsize=0)  Line 2076	C++
>::~basic_string<char,std::char_traits<char>,std::allocator<char> >()
 Line 906	C++
vs2005-activemq-example.exe!HelloWorldConsumer::onMessage(const cms::Message * message=0x00c1aa58)
 Line 246	C++
& data={...})  Line 432	C++
& data={...})  Line 189	C++
activemq-cppd.dll!activemq::core::ActiveMQSessionExecutor::dispatchAll()  Line 274	C++
activemq-cppd.dll!activemq::core::ActiveMQSessionExecutor::run()  Line 213	C++
activemq-cppd.dll!activemq::concurrent::Thread::runCallback(void * param=0x00c11ad8)  Line
152 + 0x13 bytes	C++
msvcr80d.dll!_callthreadstartex()  Line 348 + 0xf bytes	C
msvcr80d.dll!_threadstartex(void * ptd=0x00c13088)  Line 331	C

The code that crashes is this:

if( textMessage != NULL ) {
    text = textMessage->getText();
} else {
    text = "NOT A TEXTMESSAGE!";

It crashes where the destructor for text is called, because it's trying to deallocate the
string from the wrong heap. This doesn't make complete sense to me yet, but it doesn't look
good for the mixing of runtimes.

> Provide a way to allocate and free with the same allocator
> ----------------------------------------------------------
>                 Key: AMQCPP-118
>                 URL:
>             Project: ActiveMQ C++ Client
>          Issue Type: Improvement
>            Reporter: Albert Strasheim
>            Assignee: Nathan Mittler
>             Fix For: 2.1
> Cross-runtime allocation and deallocation can cause problems on Windows (and maybe other
platforms) where you can have code linked against more than one runtime in the same program.
There should be a way to be sure that you allocate and deallocate AMQCPP objects using code
linked against the same runtime (i.e. allocate and deallocate from the same heap).
> More details in this thread:
> []
> and here:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message