tcp name resolver unconstrained memory use

Bug #739789 reported by Jeff Hill
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Jeff Hill

Bug Description

I am looking at this code in the TCP name resolution implementation, and it appears that if the tcp circuit is unresponsive then this code will use an unconstrained amount of memory. The solution in the application thread is to force a block , until backlog is reduced, if too much protocol is outstanding. However in this context we are being called by the udp search agent thread and so blocking is not an option.

void SearchDestTCP :: searchRequest (
    epicsGuard < epicsMutex > & guard,
        const char * pBuf, size_t len )
    // restart circuit if it was shut down
    if ( ! _ptcpiiu ) {
        tcpiiu * piiu = NULL;
        bool newIIU = _cac.findOrCreateVirtCircuit (
            guard, _addr, cacChannel::priorityDefault,
            piiu, CA_UKN_MINOR_VERSION, this );
        if ( newIIU ) {
            piiu->start ( guard );
        _ptcpiiu = piiu;

    // does this server support TCP-based name resolution?
    if ( CA_V412 ( _ptcpiiu->minorProtocolVersion ) ) {
        guard.assertIdenticalMutex ( _ptcpiiu->mutex );
        assert ( CA_MESSAGE_ALIGN ( len ) == len );
        comQueSendMsgMinder minder ( _ptcpiiu->sendQue, guard );
        _ptcpiiu->sendQue.pushString ( pBuf, len );
        minder.commit ();
        _ptcpiiu->flushRequest ( guard );

Jeff Hill (johill-lanl)
tags: added: ca client library name resolution tcp
Changed in epics-base:
assignee: nobody → Jeff Hill (johill-lanl)
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.