question

Upvotes
Accepted
46 4 5 10

exceptional data cause app using ema c++ sdk crash

Hello, everyone, I'm currently using EMA C++ SDK with version Real-Time-SDK-Elektron-SDK-1.5.0.G1. My application will crash sometimes when receiving exceptional data. The callstack dumpped from gdb is as follows:

#0  0x00007f4c5c36f337 in raise () from /lib64/libc.so.6
#1  0x00007f4c5c370a28 in abort () from /lib64/libc.so.6
#2  0x00000000008bc6a5 in rsslfail (line=34, file=0x109f318 "/mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Codec/fieldListDecoder.c", msg=0x109f390 "Invalid iterator use - check buffer",
    cond=0x109f37c "oIter->_curBufPtr") at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Codec/./rtr/retmacros.h:27
#3  rsslDecodeFieldList (oIter=0x2460a358, oFieldList=0x2460a308, iLocalSetDb=0x0) at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Codec/fieldListDecoder.c:34
#4  0x00000000004e5d3f in thomsonreuters::ema::access::FieldListDecoder::setRsslData (this=0x2460a300, majVer=14 '\016', minVer=1 '\001', rsslBuffer=0x7f4c335ea550, rsslDictionary=0x5974030, localFlSetDefDb=0x0)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/FieldListDecoder.cpp:281
#5  0x0000000000575a6d in thomsonreuters::ema::access::StaticDecoder::setRsslData (pData=0x255ca520, pRsslBuffer=0x7f4c335ea550, rsslType=132 '\204', majVer=14 '\016', minVer=1 '\001', dictionary=0x5974030)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/StaticDecoder.cpp:106
#6  0x000000000058811b in thomsonreuters::ema::access::UpdateMsgDecoder::setRsslData (this=0x255ca400, majVer=14 '\016', minVer=1 '\001', rsslMsg=0x7f4c335ea510, rsslDictionary=0x5974030)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/UpdateMsgDecoder.cpp:49
#7  0x0000000000575798 in thomsonreuters::ema::access::StaticDecoder::setRsslData (pData=0x187b9b58, pRsslMsg=0x7f4c335ea510, majVer=14 '\016', minVer=1 '\001', dictionary=0x5974030)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/StaticDecoder.cpp:69
#8  0x00000000006480e2 in thomsonreuters::ema::access::ItemCallbackClient::processUpdateMsg (this=0x187b9b00, pRsslMsg=0x7f4c335ea510, pRsslReactorChannel=0x187c8000, item=0x25226840, pRsslDataDictionary=0x5974030)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/ItemCallbackClient.cpp:3194
#9  0x000000000064747e in thomsonreuters::ema::access::ItemCallbackClient::processCallback (this=0x187b9b00, pRsslReactor=0x187c6000, pRsslReactorChannel=0x187c8000, pEvent=0x7f4c335e9510)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/ItemCallbackClient.cpp:3036
#10 0x00000000006809a2 in thomsonreuters::ema::access::OmmBaseImpl::itemCallback (pRsslReactor=0x187c6000, pRsslReactorChannel=0x187c8000, pEvent=0x7f4c335e9510)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/OmmBaseImpl.cpp:2117
#11 0x000000000074e139 in _reactorCallDefaultCallback (pReactorImpl=0x187c6000, pReactorChannel=0x187c8000, pOpts=0x7f4c335ea470)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:3584
#12 0x000000000074fc56 in _reactorProcessMsg (pReactorImpl=0x187c6000, pReactorChannel=0x187c8000, pOpts=0x7f4c335ea470) at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:4133
#13 0x0000000000750c0a in _reactorWatchlistMsgCallback (pWatchlist=0xbe36400, pEvent=0x7f4c335eabf0, pError=0x187c7150) at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:4420
#14 0x00000000007baae4 in wlItemRequestSendMsgEvent (pBase=0xbe36400, pEvent=0x7f4c335eabf0, pItemRequest=0x1ed2e6e0, pErrorInfo=0x187c7150)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/Watchlist/wlItem.c:1636
#15 0x0000000000776453 in wlSendMsgEventToItemRequest (pWatchlistImpl=0xbe36400, pEvent=0x7f4c335eabf0, pItemRequest=0x1ed2e6e0, pErrorInfo=0x187c7150)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/Watchlist/rsslWatchlistImpl.c:4439
#16 0x0000000000770abf in wlFanoutItemMsgEvent (pWatchlistImpl=0xbe36400, pItemStream=0x1d4c6d80, pEvent=0x7f4c335eabf0, pErrorInfo=0x187c7150)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/Watchlist/rsslWatchlistImpl.c:2232
#17 0x000000000076f2c2 in rsslWatchlistReadMsg (pWatchlist=0xbe36400, pOptions=0x7f4c335ead40, currentTime=1627934681818, pErrorInfo=0x187c7150)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/Watchlist/rsslWatchlistImpl.c:1537
#18 0x000000000074be56 in _reactorReadWatchlistMsg (pReactorImpl=0x187c6000, pReactorChannel=0x187c8000, pOptions=0x7f4c335ead40, pError=0x187c7150)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:2734
#19 0x0000000000750e58 in _processRsslRwfMessage (pReactorImpl=0x187c6000, pReactorChannel=0x187c8000, readOutArgs=0x7f4c335ebd40, pMsgBuf=0x187c4508, pError=0x187c7150)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:4458
#20 0x0000000000751801 in _reactorDispatchFromChannel (pReactorImpl=0x187c6000, pReactorChannel=0x187c8000, pError=0x187c7150)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:4715
#21 0x0000000000749dcd in rsslReactorDispatch (pReactor=0x187c6000, pDispatchOpts=0x7f4c335ebea0, pError=0x187c7150) at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:1923
#22 0x000000000067f73f in thomsonreuters::ema::access::OmmBaseImpl::rsslReactorDispatchLoop (this=0x187c7000, timeOut=-1, count=100, bMsgDispRcvd=@0x187c7a96: true)
    at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/OmmBaseImpl.cpp:1785
#23 0x00000000005181ad in thomsonreuters::ema::access::OmmConsumerImpl::dispatch (this=0x187c7000, timeOut=-1) at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/OmmConsumerImpl.cpp:292
#24 0x000000000050cd83 in thomsonreuters::ema::access::OmmConsumer::dispatch (this=0x55e1760, timeOut=-1) at /mnt/data/soft/elektron/Real-Time-SDK-Elektron-SDK-1.5.0.G1/Cpp-C/Ema/Src/Access/Impl/OmmConsumer.cpp:111
#25 0x000000000045020a in AppClient::Run (this=0x54e2500) at server/emaparser/consumer.cpp:900
#26 0x000000000044f8a9 in DispatcherThreadFunc (arg_none=89007360, arg=0x0, length=0x0) at server/emaparser/consumer.cpp:820
#27 0x0000000000e4f216 in Thread::LoopThreadFunc (arg=0x54e2570) at comm/util/thread.cpp:149
#28 0x00007f4c5ce1ce65 in start_thread () from /lib64/libpthread.so.0
#29 0x00007f4c5c43788d in clone () from /lib64/libc.so.6


Is there any solution for this crash ? Or how can I check if newer sdk already fix this problem? Thanks, expecting your reply.

elektronrefinitiv-realtimeelektron-sdkrrtema-apic++
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
38.1k 71 35 53

@iscas.wang

There is a known issue regarding this assertion.

When the API gets the message with the empty payload, it will crash at that assertion when using the debug library.

<updateMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="4" containerType="RSSL_DT_FIELD_LIST" flags="0x10 (RSSL_UPMF_HAS_SEQ_NUM)" updateType="0 (RDM_UPD_EVENT_TYPE_UNSPECIFIED)" seqNum="752" dataSize="0">
    <dataBody>
    </dataBody>
</updateMsg>
Fatal Error: oIter->_curBufPtr, Invalid iterator use - check buffer (file D:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS142
-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Codec\fieldListDecoder.c, line 34)

However, if the application uses the optimized library, it will run without the problem.

<updateMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="4" containerType="RSSL_DT_FIELD_LIST" flags="0x0" updateType="
0 (RDM_UPD_EVENT_TYPE_UNSPECIFIED)" dataSize="0">
    <dataBody>
    </dataBody>
</updateMsg>

<!-- End Message (Channel IPC descriptor = 316) -->
UpdateMsg
    streamId="5"
    domain="MarketPrice Domain"
    updateTypeNum="0"
    name="/JPY="
    serviceId="1"
    serviceName="DIRECT_FEED"
    Payload dataType="FieldList"
        FieldList
        FieldListEnd

    PayloadEnd
UpdateMsgEnd

Therefore, the workaround, for now, is using the optimized library. You may need to enable tracing in EMA to verify the problem by using the XmlTraceToFile configuration.

If you are an RDC contact, you can submit this issue to the API Support team via Contact Premium Support at https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-cc.

1628051454962.png


Otherwise, you may submit this issue via GitHub.


1628051454962.png (64.1 KiB)
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
38.1k 71 35 53

@iscas.wang

It is better to upgrade the application to use the new version of EMA. 1.5.0.G1 is quite old. The latest version is 2.0.2.L1. You can download it from here. Please verify the supported compilers and operating systems from the API Compatibility Matrix.

From the error, it looks like that you are using the EMA debug library. The application crashed at the assertion that is typically enabled in the debug library.

1627990605709.png

If you use the Debug library, please try to reproduce the issue with the Optimized library instead.


1627990605709.png (20.3 KiB)
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
46 4 5 10

@jirapongse.phuriphanvichai Thanks for your reply. I understand that although RSSL_ASSERT works for debug library, it is some condition that must be met. If I use optimized library and RSSL_ASSERT no long working, will it crash some place after the check when the check condition not met ? If so, I could not dump the callstack(know the detail filename and line number of source file where crash occurs) from the sdk using optimized library.

This year, I encounter this problem some times, one case is when receiving option chain code update. I raised one case on refinitive helpdesk but your developer expect did not actually resolve the problem. I have to take special caution in my application code to avoid 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.

Upvotes
46 4 5 10

@jirapongse.phuriphanvichai Thanks for your reply. I checked the latest code on github, and the assertion still exists. So the only workaround for this issue is as you've suggested, using the optimized library instead of debug library.

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.

Click below to post an Idea Post Idea