[omniORB] bug while using OmniOrb 4.0.3 on AIX 4.3 or 5.2

Bruno DELEPOUVE bruno.delepouve at dassault-aviation.fr
Thu Sep 2 15:18:25 BST 2004


Dear

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.

The problem arrives when :

   * I'm using the dynamics libs by the '-brtl'  link option
   * I 'm passing the value of a string variable to an any variable, by
     the   <<=   operator

To illustrate this problem, consider the file  'testAny.cc'

   * source file :
     #include <fstream>
     #include <iostream>
     #include <sstream>
     #include <list>
     #include <string>
     using namespace std;

     #include <stdlib.h>
     #include <stdio.h>
     #include <unistd.h>
     #include <sys/types.h>
     #include <sys/stat.h>
     #include <pwd.h>
     #include <time.h>
     #include <signal.h>
     #include <fcntl.h>

     #include <omniORB4/CORBA.h>

     OMNI_USING_NAMESPACE(omni)

     //////////////////////////////////////////////////////////////////////

     int main(int argc, char** argv)
     {
       try
       {
         CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
         CORBA::Any a;

         const char* str = "Hello";
         a <<= str;
         cout << "Sending Any containing String: " << str << endl;

         orb->destroy();
       }
       catch(CORBA::SystemException&) {
         cerr << "Caught a CORBA::SystemException." << endl;
       }
       catch(CORBA::Exception&) {
         cerr << "Caught CORBA::Exception." << endl;
       }
       catch(...)
       {
         cerr << "Caught unknown exception." << endl;
       }

       return 0;
     }

   * I compile an object file with the command :
     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

   * I generate 2 binaries files :
        o testAny_stat : it has been generated with the use of the
          omniORB statics libraries, like this :
          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
        o testAny_dyn : it has been generated with the use of the
          omniORB dynamics librarie, like this :
          xlC_r -brtl -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

   * I'm executing the examples :
        o testAny_stat : it's ok
        o testAny_dyn : it generates a core dump file; because of an
          illegale instruction

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)
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.

   * in testAny_stat, it has a non NULL value;
   * in testAny_dyn, it has a NULL value, who is the cause of the
     illegale instruction.

I should like to know why this attribut hasn't been correctly
initialized when I used the omniORB dynamics libraries ?

Thanks

Bruno Delepouve


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20040902/290b02b4/attachment.htm


More information about the omniORB-list mailing list