bugCERTI - Bugs: bug #24746, CERTI aborted after exception in...

 
 

bug #24746: CERTI aborted after exception in FederateAmbassador callback

Submitted by:  Petr Gotthard <gotthardp>
Submitted on:  Tue 04 Nov 2008 04:03:04 PM UTC  
 
Category: CERTISeverity: 4 - Important
Item Group: Software errorStatus: Ready For Test
Privacy: PublicAssigned to: Petr Gotthard <gotthardp>
Open/Closed: ClosedRelease: CVS
Reproducibility: Every TimeFixed Release: 3.3.2

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 06 Nov 2008 02:29:38 PM UTC, comment #5:

Done.

Petr Gotthard <gotthardp>
Project MemberIn charge of this item.
Thu 06 Nov 2008 01:59:15 PM UTC, comment #4:

Hi Petr,

Nice patch.
I would say you may check-in.
I agree with the solution.
I have done a clean rebuild & test.
No problem :=)

Go ahead for the commit.

Eric NOULARD <erk>
Project Administrator
Thu 06 Nov 2008 08:32:25 AM UTC, comment #3:

Here goes a proposed solution:
- upon callback failure, RTIinternalError is always sent
- other exceptions are generated only when returned by RTIA in TICK_REQUEST response
- assumption: RTIA sends "allowed" exceptions only
- when an exception occurs, the TICK state in RTIA is reset correctly
- the reason strings contain as much info as possible; e.g. name of the federate ambassador that caused the error
- the _tick_kernel function was partly moved to the privateRefs to enhance readability

(file #16793)

Petr Gotthard <gotthardp>
Project MemberIn charge of this item.
Wed 05 Nov 2008 01:28:34 PM UTC, comment #2:

The processException() should not be changed. It's used also for normal services, where other exceptions must be throwed.
I believe it's better to mandate RTIA to throw the "allowed" exceptions only. The RTIA must do this for all the other RTI services, so it can do it also for tick().

I will publish a patch here later today (once I finish all tests), so we can discuss it further.

Petr Gotthard <gotthardp>
Project MemberIn charge of this item.
Tue 04 Nov 2008 09:44:49 PM UTC, comment #1:

I would say that tick should only throw exception
that are included in its signature:

RTI::RTIambassador::tick()
throw (SpecifiedSaveLabelDoesNotExist,
ConcurrentAccessAttempted,
RTIinternalError)

thus:
1) When RTIA throw an exception it should be wrapped
into RTIinternalError which may be thrown

2) should throw RTIinternalError if communication with RTIA fails
Agreed.
throw RTIinternalError("RTIA communication FAILED")

3) should throw RTIinternalError if the federate ambassador's callback throws any exception
Agreed too, the federate exception should be caught
and properly wrapped into RTIinternalError.

4) tick() should not throw anything else Yes but
ConcurrentAccessAttempted
SpecifiedSaveLabelDoesNotExist
should be candidate for removal then.
Note that the 1516 spec says concerning evoke
that it could throw:
RTIinternalError
FederateNotExecutionMember

thus _tick_kernel should stick with this.

We could wrapped any exception inside RTIinternalError
by doing something like:

catch (WhateverRTIException& e) {
std::stringstream exceptMsg;

exceptMsg << "::" << e._name << "[" << e._reason << "]";
throw RTIinternalError(exceptMsg.c_str());
}

or more simply processException should NOT rethrow
but build the std::string.

Then we could
if (vers_Fed.getExceptionType() != e_NO_EXCEPTION)
throw RTIinternalError(privateRefs->processException(&vers_Fed));

Eric NOULARD <erk>
Project Administrator
Tue 04 Nov 2008 04:03:04 PM UTC, original submission:

There is something wrong in RTI::RTIambassador::__tick_kernel.

If a federate ambassador (in a tick call) throws e.g. RTIfederateInternalError, the exception gets re-thrown. As the tick() is not allowed to throw RTIfederateInternalError, the execution gets aborted.

My assumption is following:
- tick() should throw an exception is TICK_REQUEST from RTIA returns an exception (as checked in processException)
- tick() should throw RTIinternalError if communication with RTIA fails
- tick() should throw RTIinternalError if the federate ambassador's callback throws any exception
- tick() should not throw anything else

In fact I don't understand what's the point in throwing e.g. an RTI::ObjectNotKnown exception from federate ambassador's callback if this cannot be propagated (re-thrown) anywhere since tick() is not allowed to return this exception.
This "propagation" is currently partially done and this is what causes the CERTI abort.

Petr Gotthard <gotthardp>
Project MemberIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #16793:  except.diff added by gotthardp (32KiB - text/x-patch - Proposed change.)

 

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 gotthardp (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
    Wed 29 Apr 2009 09:06:49 AM UTCerkOpen/ClosedOpen=>Closed
      Fixed ReleaseNextRelease=>3.3.2
    Thu 06 Nov 2008 02:29:54 PM UTCgotthardpStatusFixed=>Ready For Test
    Thu 06 Nov 2008 02:29:38 PM UTCgotthardpStatusIn Progress=>Fixed
    Thu 06 Nov 2008 08:32:25 AM UTCgotthardpAttached File-=>Added except.diff, #16793
      StatusNone=>In Progress

    Back to the top


    Powered by Savane 3.1-cleanup1