[omniORB] VC++ 5.0 heap error when using -a option

Peter Craig pcraig@coactive.com
Thu, 12 Nov 1998 14:31:24 -0800


I have an VC++ 5.0 MFC dialog application that gets a heap error during
initialization. 
This error only occurs when I use the "-a" option with the omniidl2
compiler.
Any ideas?

============================================================
My IDL:
		#ifndef __ECHO_IDL__
		#define __ECHO_IDL__
			
		struct DateType				// The Date 
		{
			unsigned short 	year;
			octet		month; 		// 1..12
			octet		day;		// 1..31
		};


		interface Echo {


		  string echoString(in string mesg);
		};

		#endif 


When I run my program I get the following error during initialization:

		Debug Assertion Failed!

		Program: ...archive.exe 		[my program]
		File: dbgheap.c
		Line: 1011

		Expression: _CtrlsValidHeapPointer(pUserData)

When I go into the debugger I see the following call stack:

		_free_dbg_lk(void *,int)
		_free_dbg(void*,int)
		operator delete(void*)
		CORBA::TypeCode::'scalar deleting destructor'(unsigned
int)
		CORBA::release(CORBA::TypeCode *)
		CORBA::TypeCode::TypeCode(CORBA::TCKind,char *,char
*,CORBA::PR_structMember *,unsigned long)
		$E86()
		$E89()
		_initterm(void(void)**,void(void)**)
		_cinit()
		WinMainCRTStartup()
		KERNEL32! 77f1b304()

The code at $E86() corresponds to the last line below from echoSK.cpp:

		static CORBA::PR_structMember _02RL_Echo__tc_DateType[]
= {
		  {"year", new CORBA::TypeCode(CORBA::tk_ushort)},
		  {"month", new CORBA::TypeCode(CORBA::tk_octet)},
		  {"day", new CORBA::TypeCode(CORBA::tk_octet)} };
		static CORBA::TypeCode
_01RL_Echo__tc_DateType(CORBA::tk_struct, "IDL:Echo/DateType:1.0",
"DateType", _02RL_Echo__tc_DateType, 3);