[omniORB] Once again: Debug Assertion Failed, CrtIsValidHeapPointer(pUserData) exception

Ulf Stoermer ulf@emi.yamaha.co.jp
Wed Mar 19 00:58:01 2003


Hi Christoph,

it has often been said on this list, not to mix debug and release code
which actually is not the adequate answer.

Another answer is that you have to compile your project with the same
settings as with what the Omni libraries have been compiled. Well, this
is true but unfortunately very vague.

So here comes my bit of wisdom on this issue:

The Omni libraries link against msvcrt.lib, respectively msvcrtd.lib for
the debug versions.

Because of memory allocation issues (ask Microsoft for details) then
also your own project needs to link against msvcrt.

It doesn't even matter if Omni links against the debug and your own
code against the release version of msvcrt.lib.

So you can even compile your own code as debug version, link
against the Omni debug version, but at the same time link against
the release version of msvcrt.

To proof the point, I just took your simple example and ran it through
all combinations of configuration and linkage.

So just give msvcrt.lib or msvcrtd.lib as additional library module
in your project settings and the error will go away.

Cheers

Ulf


> -----Original Message-----
> From: omniorb-list-admin@omniorb-support.com
> [mailto:omniorb-list-admin@omniorb-support.com]On Behalf Of Christoph
> Thomalla
> Sent: Tuesday, 18 March 2003 7:59 PM
> To: omniorb-list@omniorb-support.com
> Subject: [omniORB] Once again: Debug Assertion Failed,
> CrtIsValidHeapPointer(pUserData) exception
> 
> 
> Hi,
> 
> once again I encountered this problem (Win2K, VC++6.0, omniORB4) from 
> the list. I'm rather sure I'm not mixing debug and non-debug code and 
> using the appropriate settings of README.win32. It may be reproduced 
> with this small part of code:
> 
> #include <omniORB4/CORBA.h>
> #include "stdafx.h"
> 
> int main(int argc, char* argv[])
> {          CosNaming::Name nc;
>             nc.length(1);
>             nc[0].id   = CORBA::string_dup("R2ping");
>             nc[0].kind = CORBA::string_dup("abc");
>     return 0;
> }
> 
> Has anyone solved this problem recently?
> 
> Thanks
> 
> Christoph
> 
> 
> _______________________________________________
> omniORB-list mailing list
> omniORB-list@omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
>