[omniORB] Assertion failed at giopImpl12.cc line 1949

Alex Tingle alex.omniorb at firetree.net
Tue Aug 17 20:10:43 BST 2004


On Tue, 17 Aug 2004 17:35:46 +0100
Duncan Grisby <duncan at grisby.org> wrote:

> Update to 4.0.4. In 4.0.3 and before, for historical reasons,
> ptr_arith_t was signed. That caused problems on HPUX, which uses
> numerically high addresses much more commonly than other platforms.

Yes, I saw that, but see my own follow-up post:
http://www.omniorb-support.com/pipermail/omniorb-list/2004-August/025713.html

Shifting to 'unsigned long' is certainly more correct, but I fear that
it makes the explicit cast to 'int' in omni::align_to() an even worse
bug. The fact that ptr_arith_t was signed actually helped mask the
problem with casting through int, I think.

Consider:  int x = -1;

(long)x is still -1, so all of the upper bits are set correctly.
(unsigned long)x will have the upper 32-bits set to 0, so the result is
wrong.

In any case, the cast should be to (ptr_arith_t). I've attached a patch.

regards,

-Alex

PS. I've also attached a patch for a simple error in configure.ac -
unrelated.

-- 
:: alex tingle
:: 58 kings way, harrow, mddx. uk. HA1 1XU
:: alex.tingle AT firetree.net  +44-7901-552763 
-------------- next part --------------
Index: include/omniORB4/omniInternal.h
===================================================================
RCS file: /cvsroot/omniorb/omni/include/omniORB4/Attic/omniInternal.h,v
retrieving revision 1.2.2.16
diff -c -r1.2.2.16 omniInternal.h
*** include/omniORB4/omniInternal.h	30 Apr 2004 15:58:33 -0000	1.2.2.16
--- include/omniORB4/omniInternal.h	17 Aug 2004 18:03:23 -0000
***************
*** 293,299 ****
  
    _CORBA_MODULE_FN inline ptr_arith_t align_to(ptr_arith_t p,
  					       alignment_t align) {
!     return (p + ((int) align - 1)) & ~((int) align - 1);
    }
  
    _CORBA_MODULE_FN _CORBA_ULong hash(const _CORBA_Octet* key, int keysize);
--- 293,299 ----
  
    _CORBA_MODULE_FN inline ptr_arith_t align_to(ptr_arith_t p,
  					       alignment_t align) {
!     return (p + ((ptr_arith_t) align - 1)) & ~((ptr_arith_t) align - 1);
    }
  
    _CORBA_MODULE_FN _CORBA_ULong hash(const _CORBA_Octet* key, int keysize);
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /cvsroot/omniorb/omni/Attic/configure.ac,v
retrieving revision 1.1.2.24
diff -c -r1.1.2.24 configure.ac
*** configure.ac	26 Jul 2004 13:23:26 -0000	1.1.2.24
--- configure.ac	17 Aug 2004 18:03:22 -0000
***************
*** 129,135 ****
    *-*-irix*)
      compiler_name="Compiler_SGI"
    ;;
!   *-*-irix*)
      compiler_name="Compiler_xlC"
    ;;
    esac
--- 129,135 ----
    *-*-irix*)
      compiler_name="Compiler_SGI"
    ;;
!   *-*-aix*)
      compiler_name="Compiler_xlC"
    ;;
    esac


More information about the omniORB-list mailing list