<!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 6.0.4630.0">
<TITLE>setClientCallTimeout(obj, ) crash</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I use omniORB4.0.3 and I sometimes experience crash when a client calls setClientCallTimeout(obj, ).</FONT>
<BR><FONT SIZE=2 FACE="Arial">The internal call oo = obj->_PR_getobj(); returns NULL and oo-> crash.</FONT>
</P>
<UL>
<P><FONT SIZE=2 FACE="Courier New">void</FONT>
<BR><FONT SIZE=2 FACE="Courier New">omniORB::setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong v)</FONT>
<BR><FONT SIZE=2 FACE="Courier New">{</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> omniObjRef* oo =<B> obj->_PR_getobj();</B></FONT>
<BR><FONT SIZE=2 FACE="Courier New"> oo->_setTimeout(v / 1000, (v % 1000) * 1000000);</FONT>
<BR><FONT SIZE=2 FACE="Courier New">}</FONT>
</P>
</UL>
<P><FONT SIZE=2 FACE="Arial">What is the </FONT><B></B><B> <FONT SIZE=2 FACE="Courier New">_PR_getobj();</FONT></B> <FONT SIZE=2 FACE="Courier New">job ?</FONT>
<BR><FONT SIZE=2 FACE="Arial">Why it can returned NULL ?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">This seems to appears when the client narrow an obj from a valid IOR (using the name service) but the servant part is stopped at a breakpoint location. (I believe it could also happen when the server machine is dramatically overloaded). This is my code:</FONT></P>
<P><FONT SIZE=2 FACE="Courier New"> CORBA::Object_var interface_obj = </FONT>
<BR><FONT SIZE=2 FACE="Courier New"> init_naming_context->resolve( string_to_name( object_list[i] ) ) ;</FONT>
<BR><FONT SIZE=2 FACE="Courier New">…</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> PrincipalInterface_var principal_interface ;</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> try </FONT>
<BR><FONT SIZE=2 FACE="Courier New"> {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> principal_interface = PrincipalInterface::_narrow( interface_obj ) ;</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New"> </FONT><B> <FONT COLOR="#FF0000" SIZE=2 FACE="Courier New">omniORB::setClientCallTimeout( interface_obj, PrincipalInterfaceImpl::PING_TIMEOUT ); // CRASH!</FONT></B>
</P>
<P><FONT SIZE=2 FACE="Courier New"> if ( ! CORBA::is_nil( principal_interface ) ) </FONT>
<BR><FONT SIZE=2 FACE="Courier New"> {</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> principal_interface->GetStatus() ;</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Thanks for any idea </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Fred</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Courier New"> (</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> </FONT><B></B><B> <FONT FACE="Courier New">Frédéric Prin</FONT></B><FONT SIZE=2 FACE="Courier New"> )</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Senior Software Engineer /</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> S I L V A C O (</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Grenoble REsearch CEnter \</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> Tel 04 56 38 10 33 )</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> __________________________/___</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/__/__/</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/_____/</FONT>
<BR><FONT SIZE=2 FACE="Courier New"> /__/__/__/__/__/__/__/__/__/__/</FONT>
</P>
</BODY>
</HTML>