[omniORB] Uninitialized memory read errors reported in omniORB
Alex Tingle
alex.omniorb at firetree.net
Sat Mar 5 12:43:35 GMT 2005
Hi Duncan,
On Thu, 03 Mar 2005 13:07:48 +0000
Duncan Grisby <duncan at grisby.org> wrote:
> > > This is unused padding bytes in GIOP messages. It's not a problem.
> > Is there some way to initialise these bytes anyway?
> Not without changing omniORB. Look at the definition of align_to in
> include/omniORB4/omniInternal.h. If you modify that to initialise the
> padding it adds, that should catch all the cases. I'd be interested to
> see how much performance impact it has.
It's not nearly as simple as that. align_to is used when unmarshaling as well as marshaling. You only want to clear memory when marshaling.
Furthermore, the result of align_to doesn't always point to memory that is allocated yet. For example (from cdrStream.h):
again:
ptr_arith_t p1 =align_to((ptr_arith_t)s.pd_outb_mkr,align);
ptr_arith_t p2 = p1 + sizeof(type);
if( (void*)p2 > s.pd_outb_end ) {
if (s.reserveOutputSpaceForPrimitiveType(align,sizeof(type)))
goto again;
else {
s.pd_outb_mkr = (void*) p2;
break;
}
}
I think the only way to ensure that all memory is initialised is to track down all the calls to 'new', and explicitly initialise each one.
Sadly, I've not got the time to do that right now.
-Alex
--
:: alex tingle
:: http://www.firetree.net/consulting/
:: alex.tingle AT firetree.net +44-7901-552763
More information about the omniORB-list
mailing list