IBM Support

PH00797: CRASH IN THE SXF FRAMEWORK OMMAINTHREAD::POSTTIMEOUTS CODE

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

APAR status

  • Closed as program error.

Error description

  • While running our application which uses the SXF framework, the
    following happened:
    SYSTEM HALTED STATE: PARTITION EXECUTION ERROR: MEMORY VIOLATION
    ACTION: Shutdown 0x00187d98-->0xdead0102
    
    After analysis, the memory violation address corresponds to the
    Rhapsody SXF library function OMMainThread::postTimeouts.
    Specifically, when the ⠜dest⠝ pointer is used without
    checking for NULL: const bool retCode =
    dest->getActiveContext()->queueEvent( aTimeout );
    
    What we did for now was to add the following correction to this
    function: if (dest != NULL) This crash does not consistently
    occur and is not easily reproducible, however it happened at
    least 3 times.
    

Local fix

  • 1)
    void OMMainThread::postTimeouts(void) {
        //#[ operation postTimeouts()
        OMTimeout* aTimeout = itsTimeoutPool.getExpiredTimeout();
        //all expired timeouts should be put into appropriate event
    queue
        while (aTimeout != NULL ) {
        // Add expired Timeout to the event queue
        OMReactive* dest = aTimeout->getDestination();
        if (dest)
        {
        OMThread* threadP = dest->getActiveContext() ;
        if (threadP)
        {
        const bool retCode = threadP->queueEvent( aTimeout );
        if (!retCode)
        {
        dest->handleTmEventNotQueued(aTimeout);
        }
        }
        }
        aTimeout = itsTimeoutPool.getExpiredTimeout();
        }
        //#]
    }
    
    2) remove destination NULL setting in OMTimeout::cancel function
    (the fixed code is above):
    
    bool OMTimeout::cancel(void) {
        //#[ operation cancel()
        // remove timeout from itsBusyList
        /*LDRA_INSPECTED 72 D : MISRA-C++:2008 5-0-1: use "this" as
    an argument to modify link lists of free and busy timeouts*/
        if (itsOMTimeoutPool != NULL)
        {
        itsOMTimeoutPool->removeTm( this );
        }
        return true;
    
        //#]
    }
    
    3) adding this assignment to the removeTm function:
    
    void OMTimeoutPool::removeTm(const OMTimeout* const tm) {
        //#[ operation removeTm(OMTimeout)
        (void)OMOSSpecific::lock(tmPoolGuard);
        // Iterate down the busy list looking for the requested
    timeout.
        OMTimeout* aTimeout = itsBusyList;
        OMTimeout* parent = NULL;
        OMTimeout* next = NULL;
    
        while ( aTimeout != NULL ) {
        next = aTimeout->getItsNextTimeout();
        if (aTimeout == tm)
        {
        // found it, so remove it from the busy list
        aTimeout->setDestination(NULL);
        if ( parent == NULL ) {
          itsBusyList = next;
        }
        else
    ......
    }
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Rhapsody                                                     *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * Crash in the SXF framework OMMainThread::postTimeouts code   *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    

Problem conclusion

  • Racing condition avoided by setting timeout destination
    assignment under critical section.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH00797

  • Reported component name

    TLOGIC RHAPSODY

  • Reported component ID

    5724V74RP

  • Reported release

    821

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-07-23

  • Closed date

    2019-04-29

  • Last modified date

    2019-04-29

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    TLOGIC RHAPSODY

  • Fixed component ID

    5724V74RP

Applicable component levels



Document information

More support for: Rational Rhapsody

Software version: 821

Reference #: PH00797

Modified date: 29 April 2019