g_assert problem in ORBit2-2.3.100 on Solaris...




What is the purpose of the following "g_assert" ref: line 857 in poa.c function "ORBIT_POA_create_object"?
(note: I am running ORBit2 on Solaris)

It looks to me like it would probably never be "TRUE".

When I get to this g_assert my

objid->_length = 13       // 12 Char's in _buffer + 1 for \nul terminating char.
objid->_buffer = "myEchoServer"
objid->_release = '\0'
objid->_maximum = 0


include/orbit/util/basic_types.h:typedef guint32   CORBA_unsigned_long;
src/orb/poa/orbit-poa.h:#define ORBIT_RAND_DATA_LEN 8

So decoding the g_assert we have:

     g_assert( 13 == ( 4 + 8 ) ) ;

Since "objid->_length" is the length of the string in "objid->_buffer" this doesn't seem reasonable.

Maybe the g_assert should be:   g_assert ( objid->_lenth > 0 );

Comments?

___________
        if (poa->p_id_assignment == PortableServer_SYSTEM_ID) {
                if (objid) {
                        g_assert(objid->_length == sizeof (CORBA_unsigned_long) + ORBIT_RAND_DATA_LEN);

                        newobj->object_id          = PortableServer_ObjectId__alloc ();
                        newobj->object_id->_length = objid->_length;
                        newobj->object_id->_buffer = PortableServer_ObjectId_allocbuf (objid->_length);
                        newobj->object_id->_release = CORBA_TRUE;

                        memcpy (newobj->object_id->_buffer, objid->_buffer, objid->_length);
                }
                else
                        newobj->object_id = ORBit_POA_new_system_objid (poa);
        } else {
                newobj->object_id           = PortableServer_ObjectId__alloc ();
                newobj->object_id->_length  = objid->_length;
                newobj->object_id->_buffer  = PortableServer_ObjectId_allocbuf (objid->_length);
                newobj->object_id->_release = CORBA_TRUE;

                memcpy(newobj->object_id->_buffer, objid->_buffer, objid->_length);
        }


_________

--
David Haverkamp
dahaverk@rockwellcollins.com





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]