<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Dear
<p>I am trying to migrate an application using OmniORB 4.0.2 on AIX 4.3
to omniORB 4.0.3 on AIX 5.2 (or AIX 4.3), and i have a problem with the
use of dynamics libraries libomniORB4.so.0.3, libomniDynamic4.so.0.3
and libomniCodeSets4.so.0.3.
<p>The problem arrives when :
<ul>
<li>
I'm using the dynamics libs by the '-brtl' link option</li>
<li>
I 'm passing the value of a string variable to an any variable, by the
<<= operator</li>
</ul>
To illustrate this problem, consider the file 'testAny.cc'
<ul>
<li>
source file :</li>
<br>#include <fstream>
<br>#include <iostream>
<br>#include <sstream>
<br>#include <list>
<br>#include <string>
<br>using namespace std;
<p>#include <stdlib.h>
<br>#include <stdio.h>
<br>#include <unistd.h>
<br>#include <sys/types.h>
<br>#include <sys/stat.h>
<br>#include <pwd.h>
<br>#include <time.h>
<br>#include <signal.h>
<br>#include <fcntl.h>
<p>#include <omniORB4/CORBA.h>
<p>OMNI_USING_NAMESPACE(omni)
<p>//////////////////////////////////////////////////////////////////////
<p>int main(int argc, char** argv)
<br>{
<br> try
<br> {
<br> CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
<br> CORBA::Any a;
<p> const char* str = "Hello";
<br> a <<= str;
<br> cout << "Sending Any containing String: "
<< str << endl;
<p> orb->destroy();
<br> }
<br> catch(CORBA::SystemException&) {
<br> cerr << "Caught a CORBA::SystemException."
<< endl;
<br> }
<br> catch(CORBA::Exception&) {
<br> cerr << "Caught CORBA::Exception." <<
endl;
<br> }
<br> catch(...)
<br> {
<br> cerr << "Caught unknown exception." <<
endl;
<br> }
<p> return 0;
<br>}
<br>
<li>
I compile an object file with the command :</li>
<br>xlC_r -g -c -DHAVE_CONFIG_H -DHAVE_OMNIORB4 -D__OMNIORB4__ -D_REENTRANT
-D_THREAD_SAFE -qstaticinline -D__aix__ -D__powerpc__ -D__OSVERSION__=5
-qarch=com -qnotempinc -DAIX -DPASS_END -qrtti -qmaxmem=8192 -qlonglong
-qlongdouble -I. -I/Projet/JULIUS/ORB/omniORB-4.0.3-AIX-5.2-xlc_r-6_Debug/include
-o testAny.o testAny.cc
<br>
<li>
I generate 2 binaries files :</li>
<ul>
<li>
<b>testAny_stat</b> : it has been generated with the use of the omniORB
statics libraries, like this :</li>
<br>xlC_r -o testAny_stat testAny.o -L/Projet/JULIUS/ORB/omniORB-4.0.3-AIX-5.2-xlc_r-6_Debug/lib
-lomniORB4 -lomniDynamic4 -lomnithread -lpthread
<li>
<b>testAny_dyn</b> : it has been generated with the use of the omniORB
dynamics librarie, like this :</li>
<br>xlC_r <b>-brtl</b> -o testAny_dyn testAny.o -L/Projet/JULIUS/ORB/omniORB-4.0.3-AIX-5.2-xlc_r-6_Debug/lib
-lomniORB4 -lomniDynamic4 -lomnithread -lpthread
<br> </ul>
<li>
I'm executing the examples :</li>
<ul>
<li>
testAny_stat : it's ok</li>
<li>
testAny_dyn : it generates a core dump file; because of an illegale instruction</li>
</ul>
</ul>
I found the reason of the core file. Each Corba Object has its own
cdrStream object. An CORBA::any object uses this object to
execute the <<= operator. (in cdrStream.h file,
look at the line 454)
<br>The cdrStream class has an attribut TCS_C pd_tcs_c.
In the cdrStream object associated to CORBA::any object, this
attribut has been initialised differently.
<ul>
<li>
in testAny_stat, it has a non NULL value;</li>
<li>
in testAny_dyn, it has a NULL value, who is the cause of the illegale instruction.</li>
</ul>
<p><br>I should like to know why this attribut hasn't been correctly initialized
when I used the omniORB dynamics libraries ?
<p>Thanks
<p>Bruno Delepouve
<ul>
<ul> </ul>
</ul>
</html>