[omniORB] Can I ignore RtlFreeHeap assert when String_var is destructed?

Mark Elder MarkElder@Martin-Group.com
Thu, 10 May 2001 17:13:07 -0500


Hello,

I am new to OmniOrb and to MVC++ in general (I'm being converted from a VB
programmer :-) ).

I don't like things happening that I don't understand - in this case I have
something very simple that I might be able to ignore, but I hate to do that
without knowing what is really going on.

I have a very simple main program that just creates a String_var and then
lets it be destructed.  The problem is that I hit a User Breakpoint when
delete is called - caused by a invalid address . HEAP[string_dup.exe]:
Invalid Address specified to RtlFreeHeap( 530000, 444060 )

I have tried to find some information online with limited success.  It seems
like part of the problem deals with each dll having it's own heap??  And
maybe something about the new and delete functions being declared and
defined inline in a shared header file?  One of the articles I found
mentioned that the problem goes away if you statically linked the libs.
Indeed when I switched to the static libs and used the _WINSTATIC define
there was no heap assert.

Is this something I can safely ignore?  Will I see this with other *_var
objects as well?  Is there some way to stop this assert from halting the
program every time?

Thanks for any help!

Mark Elder


Here is my program and the stack.

int main(int argc, char* argv[])
{
    CORBA::String_var s = CORBA::string_dup("abc");
    return 0;
}


NTDLL! DbgBreakPoint@0 address 0x77f9eea9
NTDLL! RtlpBreakPointHeap@4 + 38 bytes
NTDLL! RtlpValidateHeapEntry@12 + 134277 bytes
NTDLL! RtlValidateHeap@12 + 165 bytes
KERNEL32! HeapValidate@12 + 18 bytes
_CrtIsValidHeapPointer(const void * 0x00444080) line 1697
_free_dbg(void * 0x00444080, int 1) line 1044 + 9 bytes
operator delete(void * 0x00444080) line 49 + 16 bytes
omni::freeString(char * 0x00444080) line 240 + 33 bytes
_CORBA_String_var::~_CORBA_String_var() line 109 + 11 bytes
main(int 1, char * * 0x00530f80) line 10 + 15 bytes
mainCRTStartup() line 206 + 25 bytes
KERNEL32! BaseProcessStart@4 + 115547 bytes