bugCERTI - Bugs: bug #37721, Error:Object Class delete

 
 

bug #37721: Error:Object Class delete

Submitted by:  YongChangShi <shijian>
Submitted on:  Mon 12 Nov 2012 02:04:52 PM UTC  
 
Category: CERTISeverity: 3 - Normal
Item Group: Software errorStatus: Need Info
Privacy: PublicAssigned to: Eric NOULARD <erk>
Open/Closed: ClosedRelease: 3.4.1
Reproducibility: Every TimeFixed Release: 3.4.1

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 02 Apr 2015 01:10:45 PM UTC, comment #2:

Closing it because I lack the feedback info.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Fri 27 Sep 2013 07:33:14 AM UTC, comment #1:

Hi ShiJian,

Same as other bug report of yours.
Please explain what is the exact error/bug your are
trying to fix.

And provide a patch:
http://stackoverflow.com/questions/1648595/how-to-create-a-patch-file-on-windows

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Mon 12 Nov 2012 02:04:52 PM UTC, original submission:

I have fiexed this bug. please check that!
file: ObjectClassSet.cc
function: killFederate

original:
void ObjectClassSet::killFederate(FederateHandle theFederate)
throw ()
{
ObjectClassBroadcastList *ocbList = NULL ;
ObjectClassHandle currentClass = 0 ;

handled_iterator i;

for (i = fromHandle.begin(); i != fromHandle.end(); ++i) {
// Call KillFederate on that class until it returns NULL.
do {
D.Out(pdExcept, "Kill Federate Handle %d .", theFederate);
ocbList = i->second->killFederate(theFederate);

D.Out(pdExcept, "Federate Handle %d Killed.", theFederate);

// Broadcast RemoveObject message recursively
if (ocbList != 0) {
currentClass = i->second->getSuperclass();
D.Out(pdExcept, "List not NULL");
while (currentClass != 0) {
D.Out(pdRegister,
"Broadcasting Remove msg to parent class %d(Killed).",
currentClass);

// It may throw ObjectClassNotDefined
i->second = getObjectFromHandle(currentClass);

i->second->broadcastClassMessage(ocbList);

currentClass = i->second->getSuperclass();
}

delete ocbList ;
}
} while (ocbList != NULL);
}
D.Out(pdExcept, "End of the KillFederate Procedure.");
} /* end of killFederate */

fixed:
void ObjectClassSet::killFederate(FederateHandle theFederate)
throw ()
{
/ShiJian:Begin/
ObjectClassBroadcastList *ocbList = NULL ;
ObjectClassHandle currentClassHandle = 0 ;
bool judge=false;//Added
ObjectClass* currentClass = NULL ;//Added

handled_iterator i;
for (i = fromHandle.begin(); i != fromHandle.end(); ++i) {

// Call KillFederate on that class until it returns NULL.
do {
D.Out(pdExcept, "Kill Federate Handle %d .", theFederate);

currentClass=i->second;
ocbList = currentClass->killFederate(theFederate);

judge=false;

D.Out(pdExcept, "Federate Handle %d Killed.", theFederate);

// Broadcast RemoveObject message recursively
if (ocbList != NULL) {
currentClassHandle = currentClass->getSuperclass();
D.Out(pdExcept, "List not NULL");
while (currentClassHandle != 0) {
D.Out(pdRegister,
"Broadcasting Remove msg to parent class %d(Killed).",
currentClassHandle);

// It may throw ObjectClassNotDefined
currentClass = getWithHandle(currentClassHandle);

currentClass->broadcastClassMessage(ocbList);

currentClassHandle = currentClass->getSuperclass();
}

judge=true;

delete ocbList ;
ocbList=NULL;
}
} while (judge);
}
D.Out(pdExcept, "End of the KillFederate Procedure.");
/ShiJian:Begin/

}

YongChangShi <shijian>

 

(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 (Posted a comment)
  • -unavailable- added by shijian (Submitted the item)
  •  

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

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Apr 2015 01:10:45 PM UTCerkOpen/ClosedOpen=>Closed
    Fri 27 Sep 2013 07:33:14 AM UTCerkStatusNone=>Need Info
      Assigned toNone=>erk

    Back to the top


    Powered by Savane 3.1-cleanup1