bugCERTI - Bugs: bug #27227, registerObjectInstance fails(), an...

 
 

bug #27227: registerObjectInstance fails(), an object is still added to ObjectSet

Submitted by:  Rod Leonard <rleonard>
Submitted on:  Tue 11 Aug 2009 08:52:16 PM UTC  
 
Category: CERTISeverity: 3 - Normal
Item Group: HLA compliance errorStatus: Ready For Test
Privacy: PublicAssigned to: Eric NOULARD <erk>
Open/Closed: ClosedRelease: CVS
Reproducibility: Every TimeFixed Release: 3.3.3

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Wed 12 Aug 2009 03:14:17 PM UTC, comment #7:

Ok Rod,

I'm preparing a message on the topic.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Wed 12 Aug 2009 02:08:24 PM UTC, comment #6:

I'd be glad to. I'm subscribed to certi-devel now.

Rod Leonard <rleonard>
Wed 12 Aug 2009 01:57:56 PM UTC, comment #5:

Ok then.
I did make the small modification and applied
the patch to CVS HEAD.
The patch did pass the current HLA TestSuite.

As a side note even if the patch should fix the problem
our current (small) HLA TestSuite does not include
a test case for this particular case.

If you are willing to implement one it would be welcomed.
It can be done either by adding a new test federate
or using one of the existing interactive federate
(create_destroy or InteractiveFederate) which may
be used along with a new dtest script.

I'll provide more info on the mailing list if your are wanting
to try that.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Wed 12 Aug 2009 01:27:04 PM UTC, comment #4:

You're absolutely right, objects->registerObjectInstance() only adds the object to the set at the very end of the function, so there's no object to delete if it throws an exception. Sorry about that.

Rod Leonard <rleonard>
Wed 12 Aug 2009 01:17:32 PM UTC, comment #3:

The patch is almost OK.

A small remark, could you tell me why
in RootObject::registerObjectInstance
you did include both

object = objects->registerObjectInstance(the_federate, the_class,
the_object, the_object_name);

ObjectClasses->registerObjectInstance(the_federate, object, the_class);

in the try, I would rather only put the second call in the try.
Because if the first call raise an exception the
objects->deleteObjectInstance
call used in the catch patch will most probably raise another
exception too.

Am I right or did I miss something?

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Wed 12 Aug 2009 08:15:50 AM UTC, comment #2:

Currently reviewing and testing the patch.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Wed 12 Aug 2009 08:13:23 AM UTC, comment #1:

Adding dependency to patch tracker.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Tue 11 Aug 2009 08:52:16 PM UTC, original submission:

When registerObjectInstance() fails with an exception because the object has not been published or declared, an object with the same name cannot be registered, even if the exception has been caught and the problem resolved.

This happens because the object is added to the ObjectSet in the federation before there is a check to determine if the object has been published before. When attempting to re-register an object with the same name, the ObjectSet already contains the object from the failed register attempt.

A patch is included to solve the above problem by removing the object from the set if an exception is thrown. The patch also includes a call to the free command on objectHandles so that the handle id may be reused in the federation. However, the free function appears to be commented out so this has no effect for now, and I thought it wise to leave that alone, as it was probably commented out for a reason.

Rod Leonard <rleonard>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #18558:  certi_registerObjectInstance.patch added by rleonard (2KiB - application/octet-stream - Patch to fix the above bug)

 

Digest:
   patch dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by erk (Posted a comment)
  • -unavailable- added by rleonard (Submitted the item)
  •  

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

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 21 Oct 2009 09:51:15 AM UTCerkFixed ReleaseNextRelease=>3.3.3
      Open/ClosedOpen=>Closed
    Wed 12 Aug 2009 01:57:56 PM UTCerkStatusIn Progress=>Ready For Test
      Fixed ReleaseUnknown=>NextRelease
    Wed 12 Aug 2009 08:15:50 AM UTCerkStatusNone=>In Progress
      Assigned toNone=>erk
    Wed 12 Aug 2009 08:13:24 AM UTCerkDependencies-=>Depends on patch #6894
    Tue 11 Aug 2009 08:52:17 PM UTCrleonardAttached File-=>Added certi_registerObjectInstance.patch, #18558

    Back to the top


    Powered by Savane 3.1-cleanup1