[omniORB] Assertion failed at giopImpl12.cc line 1949

Alex Tingle alex.tingle at bronermetals.com
Tue Aug 3 19:02:34 BST 2004


Replying to my own post... Could there be an error in omni::align_to()?

giopImpl12.cc:1949 looks like:

   omni::ptr_arith_t newmkr = 
omni::align_to((omni::ptr_arith_t)g->pd_outb_mkr,
					    align);
   OMNIORB_ASSERT(newmkr <= (omni::ptr_arith_t)g->pd_outb_end);

And here's the definition of omni::align_to(), from omniInternal.h:

   #if SIZEOF_PTR == SIZEOF_LONG
     typedef long ptr_arith_t;
   #elif SIZEOF_PTR == SIZEOF_INT
     typedef int ptr_arith_t;
   #else
   #error "No suitable type to do pointer arithmetic"
   #endif

   enum alignment_t { ALIGN_1 = 1, ALIGN_2 = 2, ALIGN_4 = 4, ALIGN_8 = 8 
};

   _CORBA_MODULE_FN inline ptr_arith_t align_to(
     ptr_arith_t p, alignment_t align)
   {
     return (p + ((int) align - 1)) & ~((int) align - 1);
   }

Now, if SIZEOF_PTR == SIZEOF_LONG (as it is on the 64-bit HPUX), then 
surely the explicit cast to 'int' in align_to() runs the risk of losing 
the upper 8-bytes of the address? align_to() should be....

   return (p + ((ptr_arith_t) align - 1)) & ~((ptr_arith_t) align - 1);

Have I missed  something here?

-Alex Tingle

--
Dammit Jim, I'm a programmer... not a mind reader!
On 3 Aug 2004, at 16:37, Alex Tingle wrote:

> Hello,
>
> Anyone have any idea what might cause this error?
>
> Server is running omniORB4.0.3 on HPUX. I think that the servant has 
> just finished dealing with a call, and the ORB is marshalling the 
> response. Server-side error is:
>
> > omniORB: Assertion failed.  This indicates a bug in the application 
> using
> > omniORB, or maybe in omniORB itself.
> >  file: ../../../../../src/lib/omniORB/orbcore/giopImpl12.cc
> >  line: 1949
> >  info: newmkr <= (omni::ptr_arith_t)g->pd_outb_end
> > omniORB: To endpoint: giop:tcp:10.2.0.32:63049. Send GIOP 1.2 
> MessageError because > a protocol error has been detected. Connection 
> is closed.
>
> The client receives a COMM_FAILURE_UnMarshalResults, COMPLETED=YES.
>
> I'm trying to obtain a trace file but I haven't managed it yet, as the 
> error is tricky to reproduce.
>
> TIA,
>
> -Alex Tingle
>
> --
> Dammit Jim, I'm a programmer... not a mind reader!
>
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list




More information about the omniORB-list mailing list