Zoltan Bordas | 6 Jan 2009 21:28

Problem when using codesets

I found a problem when using UTF-8 encoding as the native codeset. When the response is being decoded the following code causes an access violation:

 

CORBA::Long

MICO::UniCodesetConv::decode (CORBA::Buffer &f, CORBA::ULong len,

                                                      CORBA::Char *t, CORBA::Boolean terminate)

{

    char *cp, *to;

 

    CORBA::ULong flen = _from->codepoint_size();

    if (flen == 3)

                flen = 4;

    flen *= len;

 

    if (len * _from->codepoint_size() > f.length()) {

      return -1;

    }

 

#ifdef __GNUG__

    char _f[flen+1];

#else

    CORBA::String_var _f;

    if (_from->codepoint_size() != 1)

                _f = CORBA::string_alloc (flen);

#endif

 

<<<< Access violation – _f is uninitialized >>>>    if (!f.get (_f, len * _from->codepoint_size())) {

      return -1;

 

The condition needs to be removed from the string initialization otherwise we are calling the get method to an uninitialized string.

 

Zoltan

 

--- codeset.cc.original    2008-07-25 16:41:44.000000000 -0500

+++ codeset.cc 2009-01-06 13:11:54.531250000 -0600

<at> <at> -720,9 +720,7 <at> <at>

 #ifdef __GNUG__

     char _f[flen+1];

 #else

-    CORBA::String_var _f;

-    if (_from->codepoint_size() != 1)

-              _f = CORBA::string_alloc (flen);

+    CORBA::String_var _f = CORBA::string_alloc (flen);

 #endif

 

     if (!f.get (_f, len * _from->codepoint_size())) {

_______________________________________________
Mico-devel mailing list
Mico-devel <at> mico.org
http://www.mico.org/mailman/listinfo/mico-devel
Schmidt Thomas | 5 Jan 2009 22:57
Picon
Favicon

Some more bug fixes

Hi,

Here are some more minor bug fixes:

1. mico/demo/services/relship/TestServer..cc
    BaseRole and DerivedRole should be added without path component "omg.org/".
    So instead of

        NamedRoleTypesHelper* nrth_TestRelationship = new NamedRoleTypesHelper (orb);
        nrth_TestRelationship->add ("IDL:omg.org/Test/BaseRole:1.0", "BaseRole");
        nrth_TestRelationship->add ("IDL:omg.org/Test/DerivedRole1:1.0", "DerivedRole1");

    you should better write

        NamedRoleTypesHelper* nrth_TestRelationship = new NamedRoleTypesHelper (orb);
        nrth_TestRelationship->add ("IDL:Test/BaseRole:1.0", "BaseRole");
        nrth_TestRelationship->add ("IDL:Test/DerivedRole1:1.0", "DerivedRole1");

2. mico/coss/relship/RandomGenerator_impl.cc
    Bug fix of my previous fix. Method RandomGenerator_impl::rand() should check for 'proxy' mode
    only if check for 'generate' mode failed. Instead of:

        if (mode == RandomGenerator::generate)
          number = ::rand ();
        if (mode == RandomGenerator::proxy) {
          if (!random_numbers.empty ()) {
            number = *(random_numbers.begin ());
            random_numbers.pop_front ();
          }
          else {
            //::RandomGenerator::NoSuchNumber exception;
            //throw exception;
            mico_throw (RandomGenerator::NoSuchNumber());
          }
        }

    Add an 'else':

        if (mode == RandomGenerator::generate) {
          number = ::rand ();
        }
        else if (mode == RandomGenerator::proxy) {
          if (!random_numbers.empty ()) {
            number = *(random_numbers.begin ());
            random_numbers.pop_front ();
          }
          else {
            //::RandomGenerator::NoSuchNumber exception;
            //throw exception;
            mico_throw (RandomGenerator::NoSuchNumber());
            number = 0; // Avoid compiler warnings
          }
        }
        else {
          number = 0; // Should never happen. Exception?
        }

    Otherwise rand() would ever return 'zero' in 'generate' mode.

3. ROADMAP
    'imr' is not a directory under micos devel root. Instead it is part of directory 'daemon'.


Thomas Schmidt

--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
PGP: Key-ID: 0x810B6206

_______________________________________________
Mico-devel mailing list
Mico-devel <at> mico.org
http://www.mico.org/mailman/listinfo/mico-devel
Schmidt Thomas | 8 Jan 2009 00:04
Picon
Favicon

Fwd: Some minor bug fixes after first compilation

It seems that this mail wasn't originally forwarded to the list.

Anfang der weitergeleiteten E-Mail:

Von: Schmidt Thomas <01723011505 <at> vodafone.de>
Datum: 22. Dezember 2008 13:06:24 MEZ
Betreff: Some minor bug fixes after first compilation

Hi,

I just compiled Mico 2.3.13 on MacOS X 10.4.11 (PPC) using gcc 4.0.1. After looking at some compiler warnings/errors I fixed some of them and have questions about some others:

1. /Users/tcs/src/CORBA/mico/coss/time/TimeService_impl.cc
    TimeService_impl::universal_time(): Variable 'timeV' will be used uninitialized! I don't know how to
    fix.

2. /Users/tcs/src/CORBA/mico/coss/relship/RandomGenerator_impl.cc
    RandomGenerator_impl::rand(): Value of variable 'number' may be returned uninitialized. This may
    in fact happen only on errors. F.e. an illegal 'mode' value. Three ways to resolve:
    a. Put body of the second 'if'-statement into the firsts 'else'-part.
    b. Report an error or raise an exception if 'mode' containes an unexpected value.
    c. Set 'number' to a defined value, f.e. 0.
    d. Initialize 'number' to any defined value. This may especially be useful in case of detecting empty
        'random_numbers' to avoid compiler warning.

3. /Users/tcs/src/CORBA/mico/coss/relship/randomd.cc
    main(): Variable 'generator' should be initialized.

4. /Users/tcs/src/CORBA/mico/demo/services/naming-lb/Printer_impl.cc
    Printer_impl::~Printer_impl(): The printf-statement lacks its string argument. It should be written as

printf ("-- printer %s is destroyed\n", printerName);

5. /Users/tcs/src/CORBA/mico/coss/naming/Naming_impl.cc
    NamingContext_impl::restore(): 'binding.btype' may be used uninitialized. Its value will be
    assigned near end of the function depending on variable 'type'. What should happen if 'type' is
    neither "ncontext:" nor "nobject:"?

6. /Users/tcs/src/CORBA/mico/include/coss/NamedRoleTypesHelper.h
    /Users/tcs/src/CORBA/mico/include/coss/InterfaceDefsHelper.h
    /Users/tcs/src/CORBA/mico/include/coss/ GraphsRole_impl.h
    Preprocessor include directive should be fixed to:

#include "coss/CosRelationships.h"

#include "coss/CosGraphs.h"
#include "coss/Role_impl.h"

7. /Users/tcs/src/CORBA/mico/coss/relship/GraphsRole_impl.cc
    CosGraphs_impl::Role_impl::Role_impl(): Initialization should be reordered like:

CosGraphs_impl::Role_impl::Role_impl (CosRelationships::RelatedObject_ptr obj)
  : ::Role_impl (), POA_CosGraphs::Role ()

8. My compiler reports lots of (f.e. containmentd.cc:47 + 52)

"deprecated conversion from string constant to 'char*''

9. coss/relship will not generate the library stuff when being configured with option '--enable-final'.

 
Mico installs well. Now trying out test suite and demos...


Ciao

Thomas

--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
PGP: Key-ID: 0x810B6206


--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
PGP: Key-ID: 0x810B6206

_______________________________________________
Mico-devel mailing list
Mico-devel <at> mico.org
http://www.mico.org/mailman/listinfo/mico-devel
Karel Gardas | 8 Jan 2009 09:36
Favicon

Re: Some more bug fixes


Hi Thomas,

could you be so kind and send unified or context diff of your changes?
This way I don't need to retype all your changes here through the
keyboard when you already done this anyway.

Otherwise those three fixes below looks ok.

Thanks!
Karel

Schmidt Thomas wrote:
> Hi,
> 
> Here are some more minor bug fixes:
> 
> 1. mico/demo/services/relship/TestServer.cc
>     BaseRole and DerivedRole should be added without path component
> "omg.org/".
>     So instead of
> 
>         NamedRoleTypesHelper* nrth_TestRelationship = new
> NamedRoleTypesHelper (orb);
>         nrth_TestRelationship->add ("IDL:omg.org/Test/BaseRole:1.0",
> "BaseRole");
>         nrth_TestRelationship->add ("IDL:omg.org/Test/DerivedRole1:1.0",
> "DerivedRole1");
> 
>     you should better write
> 
>         NamedRoleTypesHelper* nrth_TestRelationship = new
> NamedRoleTypesHelper (orb);
>         nrth_TestRelationship->add ("IDL:Test/BaseRole:1.0", "BaseRole");
>         nrth_TestRelationship->add ("IDL:Test/DerivedRole1:1.0",
> "DerivedRole1");
> 
> 2. mico/coss/relship/RandomGenerator_impl.cc
>     Bug fix of my previous fix. Method RandomGenerator_impl::rand()
> should check for 'proxy' mode
>     only if check for 'generate' mode failed. Instead of:
> 
>         if (mode == RandomGenerator::generate)
>           number = ::rand ();
>         if (mode == RandomGenerator::proxy) {
>           if (!random_numbers.empty ()) {
>             number = *(random_numbers.begin ());
>             random_numbers.pop_front ();
>           }
>           else {
>             //::RandomGenerator::NoSuchNumber exception;
>             //throw exception;
>             mico_throw (RandomGenerator::NoSuchNumber());
>           }
>         }
> 
>     Add an 'else':
> 
>         if (mode == RandomGenerator::generate) {
>           number = ::rand ();
>         }
>         else if (mode == RandomGenerator::proxy) {
>           if (!random_numbers.empty ()) {
>             number = *(random_numbers.begin ());
>             random_numbers.pop_front ();
>           }
>           else {
>             //::RandomGenerator::NoSuchNumber exception;
>             //throw exception;
>             mico_throw (RandomGenerator::NoSuchNumber());
>             number = 0; // Avoid compiler warnings
>           }
>         }
>         else {
>           number = 0; // Should never happen. Exception?
>         }
> 
>     Otherwise rand() would ever return 'zero' in 'generate' mode.
> 
> 3. ROADMAP
>     'imr' is not a directory under micos devel root. Instead it is part
> of directory 'daemon'.
> 
> 
> Thomas Schmidt
> 
> -- 
> Thomas Schmidt
> Schneiderstr. 16
> D-29575 Altenmedingen
> Phone: +49-5807-209976
> Cellular: +49-172-3011505
> Skype: ThCSchmidt
> Email: 01723011505 <at> vodafone.de
> PGP: Key-ID: 0x810B6206
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mico-devel mailing list
> Mico-devel <at> mico.org
> http://www.mico.org/mailman/listinfo/mico-devel

--

-- 
Karel Gardas                  kgardas <at> objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com
Karel Gardas | 8 Jan 2009 09:56
Favicon

Re: Problem when using codesets


Indeed! This is like in case of CORBA::Long
MICO::UniCodesetConv::decode (CORBA::Buffer &f, CORBA::ULong len,
                              CORBA::WChar *t, CORBA::Boolean terminate)
method below the code.

Thanks, the fix is applied now!
Karel

Zoltan Bordas wrote:
> I found a problem when using UTF-8 encoding as the native codeset. When the response is being decoded the
following code causes an access violation:
> 
> CORBA::Long
> MICO::UniCodesetConv::decode (CORBA::Buffer &f, CORBA::ULong len,
>                                                       CORBA::Char *t, CORBA::Boolean terminate)
> {
>     char *cp, *to;
> 
>     CORBA::ULong flen = _from->codepoint_size();
>     if (flen == 3)
>                 flen = 4;
>     flen *= len;
> 
>     if (len * _from->codepoint_size() > f.length()) {
>       return -1;
>     }
> 
> #ifdef __GNUG__
>     char _f[flen+1];
> #else
>     CORBA::String_var _f;
>     if (_from->codepoint_size() != 1)
>                 _f = CORBA::string_alloc (flen);
> #endif
> 
> <<<< Access violation - _f is uninitialized >>>>    if (!f.get (_f, len * _from->codepoint_size())) {
>       return -1;
> 
> The condition needs to be removed from the string initialization otherwise we are calling the get method
to an uninitialized string.
> 
> Zoltan
> 
> --- codeset.cc.original    2008-07-25 16:41:44.000000000 -0500
> +++ codeset.cc 2009-01-06 13:11:54.531250000 -0600
>  <at>  <at>  -720,9 +720,7  <at>  <at> 
>  #ifdef __GNUG__
>      char _f[flen+1];
>  #else
> -    CORBA::String_var _f;
> -    if (_from->codepoint_size() != 1)
> -              _f = CORBA::string_alloc (flen);
> +    CORBA::String_var _f = CORBA::string_alloc (flen);
>  #endif
> 
>      if (!f.get (_f, len * _from->codepoint_size())) {
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mico-devel mailing list
> Mico-devel <at> mico.org
> http://www.mico.org/mailman/listinfo/mico-devel

--

-- 
Karel Gardas                  kgardas <at> objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com
Schmidt Thomas | 8 Jan 2009 15:16
Picon
Favicon

Fwd: Some minor bug fixes after first compilation

Sorry,

to better handle my message I've converted all bug fixes to unified diffs:


Hi,

I just compiled Mico 2.3.13 on MacOS X 10.4.11 (PPC) using gcc 4.0.1. After looking at some compiler warnings/errors I fixed some of them and have questions about some others:

2. /Users/tcs/src/CORBA/mico/coss/relship/RandomGenerator_impl.cc
    RandomGenerator_impl::rand(): Value of variable 'number' may be returned uninitialized. This may
    in fact happen only on errors. F.e. an illegal 'mode' value. Three ways to resolve:
    a. Put body of the second 'if'-statement into the firsts 'else'-part.
    b. Report an error or raise an exception if 'mode' containes an unexpected value.
    c. Set 'number' to a defined value, f.e. 0.
    d. Initialize 'number' to any defined value. This may especially be useful in case of detecting empty
        'random_numbers' to avoid compiler warning.

--- RandomGenerator_impl.cc     20 Feb 2008 15:22:25 -0000      1.1
+++ RandomGenerator_impl.cc     5 Jan 2009 21:54:21 -0000       1.2
<at> <at> -42,9 +42,10 <at> <at>
 RandomGenerator_impl::rand ()
 {
   CORBA::Long number;
-  if (mode == RandomGenerator::generate)
+  if (mode == RandomGenerator::generate) {
     number = ::rand ();
-  if (mode == RandomGenerator::proxy) {
+  }
+  else if (mode == RandomGenerator::proxy) {
     if (!random_numbers.empty ()) {
       number = *(random_numbers.begin ());
       random_numbers.pop_front ();
<at> <at> -53,8 +54,12 <at> <at>
       //::RandomGenerator::NoSuchNumber exception;
       //throw exception;
       mico_throw (RandomGenerator::NoSuchNumber());
+      number = 0; // Avoid compiler warnings
     }
   }
+  else {
+    number = 0; // Should never happen. Exception?
+  }
 
   return number; 
 }

3. /Users/tcs/src/CORBA/mico/coss/relship/randomd.cc
    main(): Variable 'generator' should be initialized.

--- randomd.cc  20 Feb 2008 15:22:25 -0000      1.1
+++ randomd.cc  8 Jan 2009 14:07:09 -0000
<at> <at> -45,7 +45,7 <at> <at>
 int main (int argc, char *argv[])
 {
   CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "mico-local-orb" );
-  
+
   CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
   PortableServer::POA_var poa = PortableServer::POA::_narrow (poaobj);
   PortableServer::POAManager_var mgr = poa->the_POAManager();
<at> <at> -54,7 +54,7 <at> <at>
     usage (argv);
     exit (1);
   }
-  RandomGenerator_impl* generator;
+  RandomGenerator_impl* generator = (RandomGenerator_impl *) NULL;
 
   if (argc == 2) {
     if (strcmp (argv[1], "--generate") == 0) {
<at> <at> -96,9 +96,3 <at> <at>
   return 0;
 }
 
-
-
-
-
-
-

4. /Users/tcs/src/CORBA/mico/demo/services/naming-lb/Printer_impl.cc
    Printer_impl::~Printer_impl(): The printf-statement lacks its string argument. It should be written as

--- Printer_impl.cc     20 Feb 2008 15:22:59 -0000      1.1
+++ Printer_impl.cc     5 Jan 2009 21:41:55 -0000       1.2
<at> <at> -26,7 +26,7 <at> <at>
 
 Printer_impl::~Printer_impl ()
 {
-  printf ("-- printer %s is destroyed\n");
+  printf ("-- printer %s is destroyed\n", printerName);
 
   if (this->printerName != NULL)
     free (this->printerName);

5. /Users/tcs/src/CORBA/mico/coss/naming/Naming_impl.cc
    NamingContext_impl::restore(): 'binding.btype' may be used uninitialized. Its value will be
    assigned near end of the function depending on variable 'type'. What should happen if 'type' is
    neither "ncontext:" nor "nobject:"?

--- Naming_impl.cc      19 Dec 2008 14:46:20 -0000      1.1.1.2
+++ Naming_impl.cc      8 Jan 2009 14:10:39 -0000
<at> <at> -214,6 +214,9 <at> <at>
     else if (strcmp (type.c_str(), "nobject:") == 0) {
       binding.btype = CosNaming::nobject;
     }
+       else {
+         // ToDo: Exception?
+       }
 
     /*
      * Insert into table

6. /Users/tcs/src/CORBA/mico/include/coss/NamedRoleTypesHelper.h
    /Users/tcs/src/CORBA/mico/include/coss/InterfaceDefsHelper.h
    /Users/tcs/src/CORBA/mico/include/coss/ GraphsRole_impl.h
    Preprocessor include directive should be fixed to:
Path prefix "coss/" was missing.

#include "coss/CosRelationships.h"

#include "coss/CosGraphs.h"
#include "coss/Role_impl.h"

7. /Users/tcs/src/CORBA/mico/coss/relship/GraphsRole_impl.cc
    CosGraphs_impl::Role_impl::Role_impl(): Initialization should be reordered like:

--- GraphsRole_impl.cc  20 Feb 2008 15:22:25 -0000      1.1
+++ GraphsRole_impl.cc  5 Jan 2009 21:43:07 -0000       1.2
<at> <at> -40,7 +40,7 <at> <at>
 
 
 CosGraphs_impl::Role_impl::Role_impl (CosRelationships::RelatedObject_ptr obj)
-  : POA_CosGraphs::Role (), ::Role_impl ()
+  : ::Role_impl (), POA_CosGraphs::Role ()
 {
 #if DEBUG
   cout << "  <CosGraphs::Role_impl> constructor with params\n";


Ciao

Thomas

--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
PGP: Key-ID: 0x810B6206

_______________________________________________
Mico-devel mailing list
Mico-devel <at> mico.org
http://www.mico.org/mailman/listinfo/mico-devel
Schmidt Thomas | 8 Jan 2009 15:16
Picon
Favicon

Re: Some more bug fixes

Sorry,

Am 08.01.2009 um 09:36 schrieb Karel Gardas:

>
> Hi Thomas,
>
> could you be so kind and send unified or context diff of your changes?
> This way I don't need to retype all your changes here through the
> keyboard when you already done this anyway.
here are the unified context diffs:
>
> Otherwise those three fixes below looks ok.
>
> Thanks!
> Karel
>
> Schmidt Thomas wrote:
>> Hi,
>>
>> Here are some more minor bug fixes:
>>
>> 1. mico/demo/services/relship/TestServer.cc
>>     BaseRole and DerivedRole should be added without path component
>> "omg.org/".

--- TestServer.cc       20 Feb 2008 15:23:01 -0000      1.1
+++ TestServer.cc       5 Jan 2009 21:39:16 -0000       1.2
 <at>  <at>  -94,9 +94,9  <at>  <at> 

    NamedRoleTypesHelper*
      nrth_TestRelationship = new NamedRoleTypesHelper (orb);
-  nrth_TestRelationship->add ("IDL:omg.org/Test/BaseRole:1.0",
+  nrth_TestRelationship->add ("IDL:Test/BaseRole:1.0",
                          "BaseRole");
-  nrth_TestRelationship->add ("IDL:omg.org/Test/DerivedRole1:1.0",
+  nrth_TestRelationship->add ("IDL:Test/DerivedRole1:1.0",
                               "DerivedRole1");

>> 2. mico/coss/relship/RandomGenerator_impl.cc
>>     Bug fix of my previous fix. Method RandomGenerator_impl::rand()
>> should check for 'proxy' mode only if check for 'generate' mode  
>> failed.

--- RandomGenerator_impl.cc     20 Feb 2008 15:22:25 -0000      1.1
+++ RandomGenerator_impl.cc     5 Jan 2009 21:54:21 -0000       1.2
 <at>  <at>  -42,9 +42,10  <at>  <at> 
  RandomGenerator_impl::rand ()
  {
    CORBA::Long number;
-  if (mode == RandomGenerator::generate)
+  if (mode == RandomGenerator::generate) {
      number = ::rand ();
-  if (mode == RandomGenerator::proxy) {
+  }
+  else if (mode == RandomGenerator::proxy) {
      if (!random_numbers.empty ()) {
        number = *(random_numbers.begin ());
        random_numbers.pop_front ();
 <at>  <at>  -53,8 +54,12  <at>  <at> 
        //::RandomGenerator::NoSuchNumber exception;
        //throw exception;
        mico_throw (RandomGenerator::NoSuchNumber());
+      number = 0; // Avoid compiler warnings
      }
    }
+  else {
+    number = 0; // Should never happen. Exception?
+  }

    return number;
  }

>> 3. ROADMAP
>>     'imr' is not a directory under micos devel root. Instead it is  
>> part
>> of directory 'daemon'.

--- ROADMAP     20 Feb 2008 15:22:05 -0000      1.1
+++ ROADMAP     5 Jan 2009 21:56:10 -0000       1.2
 <at>  <at>  -7,10 +7,10  <at>  <at> 
  coss    -- CORBA Services, only naming service at the moment.  
libmicocoss is
             built in this directory.
  daemon  -- BOA daemon (micod).
+           imr - implementation repository and admin tool (imr).
  demo    -- some examples.
  doc     -- documentation.
  idl     -- idl compiler (idl).
-imr     -- implementation repository and admin tool (imr).
  include -- include files.
  ir      -- interface repository and IR server (ird).
  man     -- unix manual pages.
mic
--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
Email: 01723011505 <at> vodafone.de
PGP: Key-ID: 0x810B6206
Schmidt Thomas | 8 Jan 2009 22:37
Picon
Favicon

TimeService related bug fixes

Hi,

1. According to CORBAs "Time Service Specification, V1.1, May 2002" a TimeT value is fractioned in 100 nanoseconds. But Micos TimeService related implementations return a value fractioned in microseconds.

2. As I've reported earlier 'TimeService_impl::universal_time()' returns an uninitialized variable to calculate its return value.

Both bugs are fixed as follows:

Index: TimeService_help.cc
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_help.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_help.cc
--- TimeService_help.cc 20 Feb 2008 15:22:26 -0000 1.1.1.1
+++ TimeService_help.cc 8 Jan 2009 21:17:40 -0000
<at> <at> -50,7 +50,7 <at> <at>
    tmp *= DAYLENGTH;
    timeV += tmp;
    //in 100 nano second steps
-   timeV *= 1000000;
+   timeV *= NANO100;

    

    return timeV;
 }
<at> <at> -58,7 +58,7 <at> <at>
 //resolution is in miliseconds
 TimeBase::TimeT getInaccuracy() 
 {
-   TimeBase::TimeT retval =1000000*INACCURACY;
+   TimeBase::TimeT retval = NANO100 * INACCURACY;
    return retval;
 }

 

<at> <at> -90,7 +90,7 <at> <at>
    time_t etime;

 

    //in 100 nano second steps
-   timeV /= 1000000;
+   timeV /= NANO100;
    //Offset from Unix Epoch to 15 October 1582
    TimeBase::TimeT tmp = EPOCH2GREGOR;
    tmp *= DAYLENGTH;
Index: TimeService_help.h
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_help.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_help.h
--- TimeService_help.h 20 Feb 2008 15:22:26 -0000 1.1.1.1
+++ TimeService_help.h 8 Jan 2009 21:17:40 -0000
<at> <at> -12,6 +12,9 <at> <at>
 //inaccuracy of the internal clock in seconds
 #define INACCURACY 1

 

+//Time units according to CORBAs "Time Service Specification, V1.1, May 2002"
+#define NANO100 10000000
+
 //use the secure time? Only if your system clock is very accurate!
 //#define USESECURE 

 

Index: TimeService_impl.cc
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_impl.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_impl.cc
--- TimeService_impl.cc 20 Feb 2008 15:22:26 -0000 1.1.1.1
+++ TimeService_impl.cc 8 Jan 2009 21:17:40 -0000
<at> <at> -29,9 +29,8 <at> <at>
 CosTime::UTO_ptr
 TimeService_impl::universal_time()
 {
-   
-   TimeBase::TimeT timeV = timeV + TimeBase::TimeT(getTime());
-   TimeBase::TimeT inaccuracyV = 10000000;
+   TimeBase::TimeT timeV = TimeBase::TimeT(getTime());
+   TimeBase::TimeT inaccuracyV = NANO100;
    inaccuracyV *= INACCURACY;
    TimeBase::TdfT  tdfV = getTimezone();

 

<at> <at> -60,7 +59,8 <at> <at>
 #else   

 

    mico_throw(CosTime::TimeUnavailable());
-   
+   retval = (CosTime::UTO_ptr) NULL; // Avoid compiler warnings
+
 #endif

    

    return retval; 
Index: TimeService_uto.cc
===================================================================
RCS file: /usr/src/cvs/Communication/CORBA/mico/coss/time/TimeService_uto.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TimeService_uto.cc
--- TimeService_uto.cc 20 Feb 2008 15:22:27 -0000 1.1.1.1
+++ TimeService_uto.cc 8 Jan 2009 21:17:40 -0000
<at> <at> -73,7 +73,7 <at> <at>

 

    TimeBase::TimeT atimeV = timeV + TimeBase::TimeT(getTime());
    TimeBase::TdfT  atdfV = getTimezone();
-   TimeBase::TimeT ainaccurV = 10000000;
+   TimeBase::TimeT ainaccurV = NANO100;
    ainaccurV *= INACCURACY;

 

    UTO_impl * utoAbs = new UTO_impl(atimeV, ainaccurV , atdfV);


My development environment: Apple Macintosh, PPC, MacOSX 10.4.11, GNU gcc 4.0.1, MICO 2.3.13


Ciao

Thomas

--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
PGP: Key-ID: 0x810B6206

_______________________________________________
Mico-devel mailing list
Mico-devel <at> mico.org
http://www.mico.org/mailman/listinfo/mico-devel
Andreas Benzler | 9 Jan 2009 11:10
Picon
Picon

How to compile mico with externalize enabled?

Hi all

I would like to compile mico 2.3.13 with externalize support but all I
got was a lot of errors. I tried different configurations to solve the
problem but nothing worked out. Does some of you could manage to compile
mico with externalize support?

Here is what I did:

first try:
./configure --enable-externalize

resulting compile errors:
In file included from CosExternalization.cc:8:
./CosExternalization.h:123:31: error: coss/CosLifeCycle.h: No such file
or directory
./CosExternalization.h:124:36: error: coss/CosObjectIdentity.h: No such
file or directory
./CosExternalization.h:127:35: error: coss/CosRelationships.h: No such
file or directory
./CosExternalization.h:128:28: error: coss/CosGraphs.h: No such file or
directory

next try:
./configure --enable-externalize --enable-life

resulting compile errors:
./CosCompoundLifeCycle.h:64:36: error: coss/CosObjectIdentity.h: No such
file or directory
./CosCompoundLifeCycle.h:67:35: error: coss/CosRelationships.h: No such
file or directory
./CosCompoundLifeCycle.h:68:28: error: coss/CosGraphs.h: No such file or
directory

next try:
./configure --enable-externalize --enable-life --enable-relship

resulting compile errors:
FactoryFinder_impl.cc:27:34: error: coss/CosTradingRepos.h: No such file
or directory
In file included from ../../include/coss/FactoryFinder_impl.h:30,

                 from FactoryFinder_impl.cc:28:

../../include/coss/RegisterHelper.h:3:29: error: coss/CosTrading.h: No
such file or directory
In file included from FactoryFinder_impl.cc:28:

../../include/coss/FactoryFinder_impl.h:35: error: ‘CosTrading’ has not
been declared

next try:
 ./configure --enable-externalize --enable-life --enable-relship
--enable-trader

resulting compile errors:
/XXXXX/mico/./idl/idl --no-poa --boa --c++-skel -B../.. --any --name
CosTrading ../../include/coss/CosTrading.idl
error: --boa option is no longer supported
       (if you need BOA support, please use MICO release older than 2.3.12)

I am using a SUSE 11.1 with gcc 4.3 and the mico 2.3.13 release.

Thanks for helping

Andreas
Karel Gardas | 12 Jan 2009 09:18
Favicon

Re: patches [was: TimeService related bug fixes]


Hi Thomas,

I've tried to apply your patches over the weekend, but unfortunately
found that either your or mine MUA corrupted them and so ended applying
them manually, which give me a chance to somehow simplify some of them.

Anyway, please install darcs from here
http://wiki.darcs.net/index.html/Binaries (it's also available for your
MacOSX/PPC), version 1.x is enough and then get MICO head sources by:

darcs get --set-scripts-executable http://mico.org/mico-darcs-repository
mico

and verify that everything is there well.

Thanks!
Karel
PS: next time if possible, please either attach the patches (not
incorporate them into the email text) or just use darcs and send me
darcs patch.
--

-- 
Karel Gardas                  kgardas <at> objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com

Gmane