[omniORB] Is there a problem with omniORBpy 2.0 and Fixed types?

cp@sophos.com cp@sophos.com
Wed Mar 26 15:04:02 2003


I have been learning IDL (as I am reasonably new to CORBA), and have been 
dabbling with Fixed Types. During my investigations, using the examples in 
Fintan's Pure CORBA book as a guide, I stumbled across a problem doing 
simple arithmetic with fixed types. 

Here is some example code that demonstrates the problem:

--- The IDL for my fixed type ---

#ifndef __FIXEDTYPE_IDL__
#define __FIXEDTYPE_IDL__

module FixedTypeError {
    typedef fixed<31,2> BigMoney;
};

#endif 

---

--- The Python module to test my fixed type ---

import FixedTypeError

'''
The code in this module generates the following assertion:

    omniORB: Assertion failed.  This indicates a bug in the application 
using
    omniORB, or maybe in omniORB itself. e.g. using the ORB after it has
    been shut down.
     file: corbaFixed.cc
     line: 767
     info: bi = b.fixed_digits()

    This application has requested the Runtime to terminate it in an 
unusual way.
    Please contact the application's support team for more information.

'''

print FixedTypeError.BigMoney("0") - FixedTypeError.BigMoney("0")
print FixedTypeError.BigMoney("0") - FixedTypeError.BigMoney("1") # 
Assertion generated here
print FixedTypeError.BigMoney("1") - FixedTypeError.BigMoney("0") # ...and 
here
print FixedTypeError.BigMoney("1") - FixedTypeError.BigMoney("1")
print FixedTypeError.BigMoney("0") + FixedTypeError.BigMoney("0")
print FixedTypeError.BigMoney("0") + FixedTypeError.BigMoney("1")
print FixedTypeError.BigMoney("1") + FixedTypeError.BigMoney("0")
print FixedTypeError.BigMoney("1") + FixedTypeError.BigMoney("1")

---

It looks like there is some problem with subtraction with a zero on one 
side and a non-zero on the other.

This is not a critical problem for me as I am not relying on fixed type 
arithmetic at the moment, but I thought you might like the feedback.

Cliff


-- 
Cliff Penton, Head of Software Architecture & Research, Sophos Anti-Virus
Email: cp@sophos.com, DDI: 01235 544017, Web: www.sophos.com
Add live virus info to your website: http://www.sophos.com/link/vfeed