bugCERTI - Bugs: bug #30825, Simple subscriber get invalid...

 
 

bug #30825: Simple subscriber get invalid object class handle

Submitted by:  Eric NOULARD <erk>
Submitted on:  Fri 20 Aug 2010 11:41:26 AM UTC  
 
Category: CERTISeverity: 3 - Normal
Item Group: HLA compliance errorStatus: Ready For Test
Privacy: PublicAssigned to: Eric NOULARD <erk>
Open/Closed: ClosedRelease: 3.3.3
Reproducibility: NoneFixed Release: 3.4.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 20 Aug 2010 03:15:55 PM UTC, comment #1:

Just commited the fix to CVS HEAD.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Fri 20 Aug 2010 11:41:26 AM UTC, original submission:

Reported on the ML by Yaomin Fu:
see
http://lists.nongnu.org/archive/html/certi-devel/2010-08/msg00011.html

Buggy behavour:
A federate that does not publish and only subscribes receives incorrect object class handle as a result of querying rti by object handle if it joins the federation execution after other federates.

Expected behavour:
As a result of invoking rti ambassador service getObjectClass(ObjectHandle), the returned value is a handle of a class of which the object is. The class should be at the same level of the object in the class hierarchy tree, not the super class of the object.

Cause:
RTIA rootObject->Objects has a std::map contains (object handle, object*) pairs for published objects.
The map is populated as a consequence of message process of either register object instance or subscribe object class.
In the situation described above only the later occurs and the map is populated incorrectly.

The method call chain of message process:

RTIA sends NetworkMessage::SUBSCRIBE_OBJECT_CLASS message to RTIG
RTIG to process NetworkMessage::SUBSCRIBE_OBJECT_CLASS message:
RTIG::processSubscribeObjectClass()->FederationsList::subscribeObject()->Federation::subscribeObject()->ObjectClassSet::subscribe()->ObjectClass::subscribe()
If the last method returns as it is a new federate, the caller will invoke a discover process to send NM_Discover_Object messages to RTIA for all published objects of the subscribed class, as well as those of all its sub classes.
ObjectClassSet::subscribe()->ObjectClass::recursiveDiscovering()->ObjectClass::sendDiscoverMessages()
In the sent out message, the handle of the subscribed object class is then assigned to the objects of the subscribed class and also those of the sub class.
In other word, an object may be assigned with multiple handles of its super classes.

RTIA to process DISCOVER_OBJECT message:
TimeManagement::executeFederateService()->ObjectManagement::discoverObject()->RootObject::registerObjectInstance()->ObjectSet::registerObjectInstance()
The last method stores a (object handle, object*) pair in the object map in rootObject->Objects container.
If a DISCOVER_OBJECT mesaage with (object handle, super class handle) comes first, the object->class is set to the super class handle, and prevent the correct one coming late from being stored.
Then if RTIA is queried for class handle by object handle, incorrect answer is returned.

Fixing:
change one line of code in ObjectClass::sendDiscoverMessages() to associate correct class handle to the object,
message.objectClass = (*o)->getClass();

Note:
NetworkMessage DISCOVER_OBJECT only from RTIG to RTIA

Upon receiving REGISTER_OBJECT_INSTANCE message from federate, RTIA sends NetworkMessage::REGISTER_OBJECT message to RTIG
RTIG to process NetworkMessage::REGISTER_OBJECT message:
RTIG::chooseProcessingMethod()->RTIG::processRegisterObject()->FederationsList::registerObject()->Federation::registerObject()->RootObject::registerObjectInstance()->ObjectSet::registerObjectInstance()
Stores (object handle, class handle) correctly
If succeeded, RTIA receives REGISTER_OBJECT back from RTIG and stores (object handle, class handle) pair:
ObjectManagement::registerObject()->RootObject::registerObjectInstance()->ObjectSet::registerObjectInstance()

DISCOVER_OBJECT is also processed in:
ObjectClassSet::registerObjectInstance()->ObjectClass::registerObjectInstance()

RTIG to process UPDATE_ATTRIBUTE_VALUES message
RTIG::chooseProcessingMethod()->RTIG::processUpdateAttributeValues()->FederationsList::updateAttribute()->Federation::updateAttributeValues()->ObjectClassSet::updateAttributeValues()

Eric NOULARD <erk>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by erk (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 11 Nov 2010 11:09:45 AM UTCerkOpen/ClosedOpen=>Closed
      Fixed ReleaseCVS=>3.4.0
    Fri 20 Aug 2010 03:15:55 PM UTCerkStatusNone=>Ready For Test
      Assigned toNone=>erk
      Fixed ReleaseUnknown=>CVS
    Fri 20 Aug 2010 11:41:34 AM UTCerkSummarySimple subscrober get invalid object class handle=>Simple subscriber get invalid object class handle

    Back to the top


    Powered by Savane 3.1-cleanup1