[omniORB] Is there a problem with omniORBpy 2.0 and Fixed types?
baileyk@schneider.com
baileyk@schneider.com
Wed Mar 26 16:03:02 2003
I think this was mentioned not too long ago. It's not a problem with
subtraction. The expression in the assertion is missing an '='. Line 767
should be
OMNIORB_ASSERT(bi == b.fixed_digits());
That said, I haven't personally applied and tested this fix. None of my
IDL uses fixed type. Seeing a single '=' in an assertion is definitely a
problem though since assertions should not have side effects. Try the
above and see if it fixes the problem.
Kendall
cp@sophos.com
Sent by: To: omniORB-list@omniorb-support.com
omniorb-list-admin@omniorb- cc:
support.com Fax to:
Subject: [omniORB] Is there a problem with omniORBpy 2.0 and Fixed types?
03/26/2003 09:03 AM
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
_______________________________________________
omniORB-list mailing list
omniORB-list@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list