question

Upvotes
Accepted
1 0 0 0

RFA access violation - update message with status close

Hi

we received an update message with a response status Closed(4) and it crashes in RFA lib with access violation.

TREP 3

RFA 8.1

Message(

hintMask :81 'Q'

msgType: 1

msgModelType: 6,

respType: UpdateEnum (3)

respTypeNum: 0

header: (buffer: 0x000000)

....

respStatus: ( respState: CloseEnum (4), dataState: SuspectEnum(2), statusCode: 1)

)

What we suspect is that we'r trying to read fields and lib crashes in rsslDecodeFieldEntry with access violation.


Can you explain what kind of message is and how to manage this update?

We can provide a dump for further analysis.

Regards

Stefan

treprfarfa-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
7.6k 15 6 9

@stefan.bocskai

The link to RDMUsageGuide.pdf in my post seems to automatically generate by the forum engine. Please get the document from RFA C++ package. We provide the document under folder "<RFA 8.1 Packages>/Docs". And RDC named user can download the RFA package from https://developers.refinitiv.com/thomson-reuters-enterprise-platform/robust-foundation-api-rfa/downloads


Regarding snippet of codes you provide. Not sure that below codes is just typo?

if (data.getDataType() != rfa::data::FieldListEnum)

And actually it should be

if (data.getDataType() == rfa::data::FieldListEnum)


I would suggest you add codes to check if the data contains Blank by calling isBlank method before you decode it.

if(!data.isBlank())

{

....

}

There is some case we found the publisher send a blank field list to consumer app. Using isBlank can help detect the issue. Anyway, the best way to confirm issue is to get RSSL trace log to confirm actual data application received.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Hi @moragodkrit

I'm sorry for responding late, but we had difficulties to reproduce again the issue. It happened once and this was the latest message logged by RFA lib, I'm not 100% sure taht this was the failing message because at that precise time we wasn't able to dump the process, but looks like a good candidate.


<updateMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="66" containerType="RSSL_DT_FIELD_LIST" flags="0x10 (RSSL_UPMF_HAS_SEQ_NUM)" updateType="0 (RDM_UPD_EVENT_TYPE_UNSPECIFIED)" seqNum="23568" dataSize="0">

<dataBody>

</dataBody>

</updateMsg>


Can you have a look if additional checks should be added in our code in order to protect against access violation in it.start() call :

if (respMsg.getHintMask() & rfa::message::RespMsg::PayloadFlag)  {     const rfa::common::Data& data = respMsg.getPayload(); 
    if (data.getDataType() == rfa::data::FieldListEnum)     {              const rfa::data::FieldList& fList = static_cast<const rfa::data::FieldList&>(data);
        rfa::data::FieldListReadIterator it;         
        for (it.start(fList); !it.off(); it.forth())         {                ....         
        }     
    }  
}

Let me know if you need more details.

Regards,

Stefan

Upvotes
7.6k 15 6 9

@stefan.bocskai

I don't think the response status related to this issue because Market Price Update message does not use RespStatus (see RDMUsageGuide.pdf) so the status you see should be status that RFA reuses the object.


Typically, the application can verify whether or not the response message contains response status by checking HintMask using the following code. And it should be false when you test HintMask with the update message.


if(respMsg.getHintMask() & RespMsg::RespStatusFlag)

{

// Process RespStatus

}


And not sure that have you checked if the response message contains payload before decoding it? You can use the HintMask to check, and it should be able to help avoid the case that update message does not have a payload.


if (respMsg.getHintMask() & RespMsg::PayloadFlag)

{

// process payload

}


-Do you have the call stack from the Access Violation crash?


From the initial information, it looks like you found the crash when the application is trying to read fields and lib crashes in rsslDecodeFieldEntry with an access violation. So it could be the case that application receive unknown fid or enum value and it could be the case that the field contains a blank value. You may need to update the data dictionary to the latest version.


If you can replicate the issue again, please turn on RSSL trace log using instruction from the following link. It should be able to help us identify what kind of data or message that cause the crash.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you @moragodkrit


Here is how our code looks like following:

 if (respMsg.getHintMask() & rfa::message::RespMsg::PayloadFlag)
 {
    const rfa::common::Data& data = respMsg.getPayload();

    if (data.getDataType() != rfa::data::FieldListEnum)
    {
        const rfa::data::FieldList& fList = static_cast<const rfa::data::FieldList&>(data);
        rfa::data::FieldListReadIterator it;
        for (it.start(fList); !it.off(); it.forth())
        {
            ....
        }
    }
 }

The call stack shows this:

.dll!rsslDecodeFieldEntry(RsslDecIterator * iIter, RsslFieldEntry * oField) Line 222    C
.dll!rfa::data::FieldListReadIterator::start(const rfa::data::FieldList & fieldList, unsigned char iteratorMask, rfa::data::FieldListDef * pFieldListDef) Line 28    C


I'm not sure it helps but here are the values we can see on the _fieldEntry on the iterator:

+        rfa::data::DataEntry    {_entryAttrib={_entryType=243 'ó' _containedDataType=128 '€' _bCopy=false ...} }    rfa::data::DataEntry
        _contentMask    0 '\0'    unsigned char
+        _rwfFieldEntry    {fieldId=0 dataType=86 'V' encData={length=0 data=0x00000000 <NULL> } }    RwfFieldEntry


We'll try to have the RSSL logs enabled and send you more details if needed.

I'll appreciate also if you update the link to "RDMUsageGuide.pdf" which looks broken.


Click below to post an Idea Post Idea