FW: [omniORB] OmniORB304 and Visual Studio .Net Beta 2

Thierry Froux thierry.froux@voxco.com
Thu, 8 Nov 2001 12:54:46 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1687E.740F43D0
Content-Type: text/plain;
	charset="iso-8859-1"


Thanks for your response.
This is the first thing i've checked when the error first occured.
Unfortunately, i'm linking with the good libraries either in debug or
release mode.

Thierry

-----Original Message-----
From: Carl Thompson [mailto:cet@carlthompson.net]
Sent: Thursday, November 08, 2001 12:06
To: Thierry Froux
Subject: Re: [omniORB] OmniORB304 and Visual Studio .Net Beta 2


The problem might be that you are mixing debug and non-debug standard 
libraries which  doesn't work on VC++.  If the omniORB libraries were linked

with debug standard libraries (-MTd or -MDd) then your code must also be 
linked with debug standard libraries.  The converse (Inverse? Reverse?) is 
also true.  If you mix them you will get spurious exceptions thrown that 
will drive you insane.

Carl Thompson

Thierry Froux wrote:

> Hi,
> I was experimenting with OmniOrb304 and Visual Studio .Net beta 2 and I 
> came across a small problem.
> For my test I used your Echo sample IDL.
> 
> My project is a c++ console application without mfc or atl or managed 
> c++ support.
> 
> The code generated by omniidl works fine with Visual Studio 6 but .Net 
> throws an Unhandled exception
> exiting the _dispatch method. If I investigate the call stack I can see 
> that the exception occured in
>         msvcr70d.dll -> _CrtIsValidHeapPointer. (Debug Mode)
>         msvcr70.dll -> _CrtIsValidHeapPointer. (Release Mode)
> 
> What I did to correct the problem is change the following in the 
> generated .cc file :
> 
>         original code
>         {
>       CORBA::String_member _0RL_str_tmp;
>       _0RL_str_tmp <<=  giop_s;
>       arg_Name = _0RL_str_tmp._ptr;
>       _0RL_str_tmp._ptr = 0;     
>         }
> 
>         modified code
>         {
>       CORBA::String_member _0RL_str_tmp;
>       _0RL_str_tmp <<=  giop_s;
>       arg_Name = (const char *)_0RL_str_tmp._ptr;
>       _0RL_str_tmp._ptr = 0;     
>         }
> 
> It seems that the operator <<= is not doing what it should do ( a copy 
> of giop_s).
> Its when the stack's trying to get rid of arg_Name that the unhandled 
> exception occured.
> 
> I know that .Net is a beta product... I dont know if this problem is 
> related to a bug in microsoft's code or if
> it is related to a modification in microsoft's code. Or maybe it can be 
> related to a modification in
> microsoft's vc++ project settings.
> 
> Somebody else in my developpement team came across the same problem.
> 
> Anyway... I just tought I'll let you know )
> 
> Thank you
> 
> 
> Thierry Froux
> Senior Developper
> VOXCO inc.
> Montreal, Canada
> 


------_=_NextPart_001_01C1687E.740F43D0
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>FW: [omniORB] OmniORB304 and Visual Studio .Net Beta 2</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=2>Thanks for your response.</FONT>
<BR><FONT SIZE=2>This is the first thing i've checked when the error first occured.</FONT>
<BR><FONT SIZE=2>Unfortunately, i'm linking with the good libraries either in debug or release mode.</FONT>
</P>

<P><FONT SIZE=2>Thierry</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Carl Thompson [<A HREF="mailto:cet@carlthompson.net">mailto:cet@carlthompson.net</A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, November 08, 2001 12:06</FONT>
<BR><FONT SIZE=2>To: Thierry Froux</FONT>
<BR><FONT SIZE=2>Subject: Re: [omniORB] OmniORB304 and Visual Studio .Net Beta 2</FONT>
</P>
<BR>

<P><FONT SIZE=2>The problem might be that you are mixing debug and non-debug standard </FONT>
<BR><FONT SIZE=2>libraries which&nbsp; doesn't work on VC++.&nbsp; If the omniORB libraries were linked </FONT>
<BR><FONT SIZE=2>with debug standard libraries (-MTd or -MDd) then your code must also be </FONT>
<BR><FONT SIZE=2>linked with debug standard libraries.&nbsp; The converse (Inverse? Reverse?) is </FONT>
<BR><FONT SIZE=2>also true.&nbsp; If you mix them you will get spurious exceptions thrown that </FONT>
<BR><FONT SIZE=2>will drive you insane.</FONT>
</P>

<P><FONT SIZE=2>Carl Thompson</FONT>
</P>

<P><FONT SIZE=2>Thierry Froux wrote:</FONT>
</P>

<P><FONT SIZE=2>&gt; Hi,</FONT>
<BR><FONT SIZE=2>&gt; I was experimenting with OmniOrb304 and Visual Studio .Net beta 2 and I </FONT>
<BR><FONT SIZE=2>&gt; came across a small problem.</FONT>
<BR><FONT SIZE=2>&gt; For my test I used your Echo sample IDL.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; My project is a c++ console application without mfc or atl or managed </FONT>
<BR><FONT SIZE=2>&gt; c++ support.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; The code generated by omniidl works fine with Visual Studio 6 but .Net </FONT>
<BR><FONT SIZE=2>&gt; throws an Unhandled exception</FONT>
<BR><FONT SIZE=2>&gt; exiting the _dispatch method. If I investigate the call stack I can see </FONT>
<BR><FONT SIZE=2>&gt; that the exception occured in</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msvcr70d.dll -&gt; _CrtIsValidHeapPointer. (Debug Mode)</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msvcr70.dll -&gt; _CrtIsValidHeapPointer. (Release Mode)</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; What I did to correct the problem is change the following in the </FONT>
<BR><FONT SIZE=2>&gt; generated .cc file :</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; original code</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CORBA::String_member _0RL_str_tmp;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _0RL_str_tmp &lt;&lt;=&nbsp; giop_s;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arg_Name = _0RL_str_tmp._ptr;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _0RL_str_tmp._ptr = 0;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modified code</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CORBA::String_member _0RL_str_tmp;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _0RL_str_tmp &lt;&lt;=&nbsp; giop_s;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arg_Name = (const char *)_0RL_str_tmp._ptr;</FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _0RL_str_tmp._ptr = 0;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; It seems that the operator &lt;&lt;= is not doing what it should do ( a copy </FONT>
<BR><FONT SIZE=2>&gt; of giop_s).</FONT>
<BR><FONT SIZE=2>&gt; Its when the stack's trying to get rid of arg_Name that the unhandled </FONT>
<BR><FONT SIZE=2>&gt; exception occured.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; I know that .Net is a beta product... I dont know if this problem is </FONT>
<BR><FONT SIZE=2>&gt; related to a bug in microsoft's code or if</FONT>
<BR><FONT SIZE=2>&gt; it is related to a modification in microsoft's code. Or maybe it can be </FONT>
<BR><FONT SIZE=2>&gt; related to a modification in</FONT>
<BR><FONT SIZE=2>&gt; microsoft's vc++ project settings.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; Somebody else in my developpement team came across the same problem.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; Anyway... I just tought I'll let you know )</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; Thank you</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; Thierry Froux</FONT>
<BR><FONT SIZE=2>&gt; Senior Developper</FONT>
<BR><FONT SIZE=2>&gt; VOXCO inc.</FONT>
<BR><FONT SIZE=2>&gt; Montreal, Canada</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1687E.740F43D0--