Concurrent subscription.destroy() ? Crash when using tick42rmds transport.
Yury Batrakov
Classification: Public
Hi guys, I've faced the following issue when using OpenMAMA and tick42rmds bridge. The bridge internally creates a thread to process events from RMDS server, once a message is received that thread invokes mamaSubscription_processMsg. While the message is processed user may want to destroy the subscription (obviously in other thread). To avoid corruption of mamaSubscription object, mamaSubscription_destroy() function calls bridge->mute for the bridge to stop calling mamaSubscription_processMsg() and only then deallocates mamaSubscription. The problem with this approach is the following: here's the pseudo code for RMDS dispatching thread if(muted) { // Do not dispatch return; } // Do some other checks <-- mute() may be invoked here mamaSubscription_processMsg() // processMsg for muted subscription, may crash The solution for that is to change RMDS bridge to block in bridge->mute() call until mamaSubscription_processMsg() returns but there's another problem: mamaSubscription_processMsg and mamaSubscription_deactivate may deadlock on wombatThrottle. Consider the following scenario: 1. RMDS bridge thread invokes mamaSubscription_processMsg() for message of type initial 2. User thread invokes mamaSubscription_destroy() which acquires wombat throttle lock: if (impl->mTransport) throttle = mamaTransportImpl_getThrottle(impl->mTransport, MAMA_THROTTLE_DEFAULT); if(NULL != throttle) { wombatThrottle_lock(throttle); } 3. Then mamaSubscription_destroy calls mamaSubscription_deactivate_internal which calls our new version of bridge->mute() which waits for RMDS bridge thread to finish message processing if (impl->mSubscBridge) { impl->mBridgeImpl->bridgeMamaSubscriptionMute (impl->mSubscBridge); } 4. RMDS bridge handles initial message and tries to acquire the same throttle: #5 0x00007ffff78d4f32 in wombatThrottle_lock (throttle=0x6298e0) at mama/c_cpp/src/c/throttle.c:441 #6 0x00007ffff78a34e2 in imageRequest_stopWaitForResponse (request=0x14d1a20) at mama/c_cpp/src/c/imagerequest.c:774 #7 0x00007ffff78cbe06 in mamaSubscription_stopWaitForResponse (subscription=0xe36280, ctx=0xe364a0) at mama/c_cpp/src/c/subscription.c:1262 #8 0x00007ffff78a38fe in processPointToPointMessage (callback=0x1527e50, msg=0x642460, msgType=6, ctx=0xe364a0) at mama/c_cpp/src/c/listenermsgcallback.c:169 #9 0x00007ffff78a3f9c in listenerMsgCallback_processMsg (callback=0x1527e50, msg=0x642460, ctx=0xe364a0) at mama/c_cpp/src/c/listenermsgcallback.c:480 #10 0x00007ffff78cd825 in mamaSubscription_processMsg (subscription=0xe36280, msg=0x642460) at mama/c_cpp/src/c/subscription.c:2259 What do you think is the best way to avoid this? --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to https://www.db.com/disclosures for additional EU corporate and regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for information about privacy.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[Frank Quinn] Updated version information to 6.2.1 mama/c_cpp/src/c/generateMamaSourceFiles.bat mama/jni/build.xml mamda/c_cpp/src/cpp/generateMamdaVersion.bat mama/dotnet/src/cs/MamaVersion.cs mamda/VERSION.scons mamda/java/build.xml mama/VERSION.scons [Frank Quinn] Fixed build issue with windows scons builds mama/c_cpp/SConscript.win [Frank Quinn] Extended the MamaDateTime C++ class with timespec get/set. (#282) mama/c_cpp/src/cpp/mama/MamaDateTime.h mama/c_cpp/src/cpp/datetime.cpp [Frank Quinn] Linux 32 bit heap corruption in TEST_F (FieldPriceTestsC, mama/c_cpp/src/gunittest/c/mamamsg/msgfieldcompositetests.cpp [Frank Quinn] Fixed unit test not implementing publisher success (#288) mama/jni/src/junittests/MamaPublisherTest.java [Frank Quinn] New extended epoch, hints and precision methods (#287) mama/c_cpp/src/cpp/mama/MamaDateTime.h mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp mama/c_cpp/src/c/datetime.c mama/c_cpp/src/gunittest/cpp/MamaDateTimeTest.cpp mama/c_cpp/src/c/datetimeimpl.h mama/c_cpp/src/c/mama/datetime.h mama/c_cpp/src/cpp/datetime.cpp [Frank Quinn] Getting out of range date value now returns error (#289) mama/c_cpp/src/c/datetime.c [Frank Quinn] Updated licenses and installation files (#290) README.md SConstruct site_scons/community/command_line.py release_scripts/openmama.spec release_scripts/openmama-rpm.sh LICENSE-3RD-PARTY.txt mama/c_cpp/src/c/SConscript mama/c_cpp/src/c/bridge/qpid/SConscript [Frank Quinn] Fixed issue with crash for years prior to 1601 (#292) mama/c_cpp/src/c/datetime.c mama/c_cpp/src/c/mama/datetime.h mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
OpenMAMA 6.2.1 Released
Frank Quinn <fquinn.ni@...>
Hi Folks, We are pleased to announce the final release of OpenMAMA 6.2.1 is now available: This release exists mainly to address several issues coming out of the recent MAMA Datetime changes:
NB: This release includes the removal of the legacy _USE_32BIT_TIME_T compile time macro for 32 bit windows. Please ensure that third party application and bridges are not compiled using this macro to avoid potential corruption of data. For a complete list of all 17 issues included in this release, please see here: https://github.com/OpenMAMA/OpenMAMA/milestone/7?closed=1 A special thanks to all developers, contributors and testers who helped is getting this out door. Cheers, Frank
|
|
Code change(s) just landed on origin/next (Failure)
jenkins@...
Some changes have just been added to the origin/next branch!
No changes
Results for OpenMAMA_Snapshot_Windows CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change just landed on origin/master (Successful)
jenkins@...
Some changes have just been added to the origin/master branch!
[Frank Quinn] Added fix for spec file for fresh RPM builds release_scripts/openmama.spec [Frank Quinn] Fixed build issue with mamda testtools on windows mamda/c_cpp/src/testtools/SConscript.win [noreply] Fixed another issue with rpm generation release_scripts/openmama-rpm.sh [fquinn.ni] Added support for onSuccess publisher events mama/dotnet/src/examples/MamaPublisher/MamaPublisherCS.cs mamda/dotnet/src/examples/MamdaTradeTicker/MamdaTradeTicker.cs mama/c_cpp/src/examples/cpp/mamapublishercpp.cpp mama/c_cpp/src/c/mama/publisher.h mamda/c_cpp/src/examples/orderbooks/listenerBookPublisher.cpp mama/c_cpp/src/gunittest/cpp/MamaPublisherTest.cpp mama/c_cpp/src/c/publisher.c mama/dotnet/src/cs/MamaPublisher.cs mama/dotnet/src/cs/MamaPublisherCallback.cs mama/c_cpp/src/cpp/MamaPublisherImpl.h mama/c_cpp/src/cpp/mama/MamaPublisherCallback.h mama/c_cpp/src/cpp/MamaPublisher.cpp mamda/c_cpp/src/examples/mamdapublisher.cpp mama/c_cpp/src/examples/c/mamapublisherc.c mama/jni/src/c/mamapublisherjni.c mama/c_cpp/src/gunittest/c/publishertest.cpp [fquinn.ni] [PLAT-888] - New feature: process during conflation timer when there's mamda/c_cpp/src/cpp/orderbooks/mamda/MamdaOrderBookListener.h mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBookListener.cpp [fquinn.ni] [PLAT-888] - Fixed core and bug by adding code logic to handle when mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBookListener.cpp [fquinn.ni] MAMACPP: Remove mCvectorMsg tracking in MamaMsg. - Add unit test to mama/c_cpp/src/gunittest/cpp/MamaMsgTest.cpp mama/c_cpp/src/cpp/MamaMsg.cpp mama/c_cpp/src/cpp/mama/MamaMsg.h [fquinn.ni] UNITTEST: Run memory leak pattern once Previously, the intent of this mama/c_cpp/src/gunittest/cpp/MamaMsgTest.cpp [fquinn.ni] Fixed issue with multiple subscribers for same topic in qpid common/c_cpp/src/c/mempool.c mama/c_cpp/src/c/bridge/qpid/transport.c [Frank Quinn] fixes #269: MamdaSubscription redundantly creates Exception instance in mamda/java/com/wombat/mamda/MamdaSubscription.java [fquinn.ni] Removed package option from linux builds SConstruct site_scons/community/command_line.py [fquinn.ni] Bugfix mamdatetime 32 bit windows (#274) mama/c_cpp/src/c/SConscript.win mama/c_cpp/src/cpp/mamacpp.vcxproj msvc/PropertySheetAPRWin32Release.props site_scons/community/darwin.py mama/c_cpp/src/c/SConscript site_scons/community/command_line.py mama/c_cpp/src/c/datetime.c .travis.yml mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp site_scons/community/windows.py mama/c_cpp/src/c/mamac.vcxproj msvc/PropertySheetAPRWin64Release.props [Frank Quinn] Fixed build issue with latest RPM builds release_scripts/openmama.spec release_scripts/openmama-rpm.sh mamda/java/com/wombat/mamda/MamdaSubscription.java [noreply] Fixed issue with date time on 32 bit linux (#275) mama/c_cpp/src/c/datetimeimpl.h mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp mama/c_cpp/src/c/datetime.c [fquinn.ni] Fix Win32 MamaPublisherTestC.EventSendWithCallbacks SEH exception. mama/c_cpp/src/gunittest/c/publishertest.cpp [Frank Quinn] Updated version information to 6.2.1 mama/VERSION.scons mama/jni/build.xml mama/dotnet/src/cs/MamaVersion.cs mama/c_cpp/src/c/generateMamaSourceFiles.bat mamda/VERSION.scons mamda/c_cpp/src/cpp/generateMamdaVersion.bat mamda/java/build.xml [Frank Quinn] Fixed build issue with windows scons builds mama/c_cpp/SConscript.win [Frank Quinn] Extended the MamaDateTime C++ class with timespec get/set. (#282) mama/c_cpp/src/cpp/datetime.cpp mama/c_cpp/src/cpp/mama/MamaDateTime.h [Frank Quinn] Linux 32 bit heap corruption in TEST_F (FieldPriceTestsC, mama/c_cpp/src/gunittest/c/mamamsg/msgfieldcompositetests.cpp [Frank Quinn] Fixed unit test not implementing publisher success (#288) mama/jni/src/junittests/MamaPublisherTest.java [Frank Quinn] New extended epoch, hints and precision methods (#287) mama/c_cpp/src/c/mama/datetime.h mama/c_cpp/src/cpp/datetime.cpp mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp mama/c_cpp/src/c/datetime.c mama/c_cpp/src/cpp/mama/MamaDateTime.h mama/c_cpp/src/gunittest/cpp/MamaDateTimeTest.cpp mama/c_cpp/src/c/datetimeimpl.h [Frank Quinn] Getting out of range date value now returns error (#289) mama/c_cpp/src/c/datetime.c [Frank Quinn] Updated licenses and installation files (#290) LICENSE-3RD-PARTY.txt release_scripts/openmama-rpm.sh SConstruct README.md release_scripts/openmama.spec site_scons/community/command_line.py mama/c_cpp/src/c/SConscript mama/c_cpp/src/c/bridge/qpid/SConscript [Frank Quinn] Fixed issue with crash for years prior to 1601 (#292) mama/c_cpp/src/c/mama/datetime.h mama/c_cpp/src/c/datetime.c mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp
Results for OpenMAMA_Stable_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on OpenMAMA-6.2.1-rc2 (Failure)
jenkins@...
Some changes have just been added to the OpenMAMA-6.2.1-rc2 branch!
No changes
Results for OpenMAMA_ReleaseCandidate_Windows CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[noreply] Fixed issue with crash for years prior to 1601 (#292) mama/c_cpp/src/c/mama/datetime.h mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp mama/c_cpp/src/c/datetime.c
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
OpenMAMA-6.2.1-rc2 Now Available
Frank Quinn <fquinn.ni@...>
Hi Folks, The second release candidate for OpenMAMA 6.2.1 has just been cut and contains a few fixes put in since RC1 - see https://github.com/OpenMAMA/OpenMAMA/releases/tag/OpenMAMA-6.2.1-rc2. Once again, we appreciate the continued assistance from the community. Assuming no major issues are found, we'll aim to release the GA version on 15th June. If you find any issues, please see here for details on how to report it to us: Cheers, Frank
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[noreply] Updated licenses and installation files (#290) mama/c_cpp/src/c/SConscript release_scripts/openmama-rpm.sh mama/c_cpp/src/c/bridge/qpid/SConscript release_scripts/openmama.spec LICENSE-3RD-PARTY.txt README.md SConstruct site_scons/community/command_line.py
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Last call for OpenMAMA 6.2.1 RC2 bugs
Frank Quinn <fquinn.ni@...>
Hi Folks, I will soon be preparing a release for the second release candidate for OpenMAMA 6.2.1. Note that there are a fair few changes and bug fixes to make extended datetime work on both 32 and 64 bit platforms: 1. New explicit mamaDateTime_[gs]etFromEpochExt methods to allow bridges to explicitly set the underlying value regardless of whether or not time_t on the target system has sufficient resolution 2. New explicit getters and setters for datetime precision and hints 3. Release distributions will now include dependent libraries inside the target package and related license information will be included (changes about to land). If anyone has any further issues they would like to report please do so before the end of the day, otherwise we'll be cutting RC2 tomorrow morning. I'll send a full notification after the cut is made. Cheers, Frank
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[noreply] Getting out of range date value now returns error (#289) mama/c_cpp/src/c/datetime.c
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[noreply] New extended epoch, hints and precision methods (#287) mama/c_cpp/src/c/mama/datetime.h mama/c_cpp/src/cpp/mama/MamaDateTime.h mama/c_cpp/src/cpp/datetime.cpp mama/c_cpp/src/c/datetime.c mama/c_cpp/src/gunittest/cpp/MamaDateTimeTest.cpp mama/c_cpp/src/c/datetimeimpl.h mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[noreply] Fixed unit test not implementing publisher success (#288) mama/jni/src/junittests/MamaPublisherTest.java
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] Linux 32 bit heap corruption in TEST_F (FieldPriceTestsC, mama/c_cpp/src/gunittest/c/mamamsg/msgfieldcompositetests.cpp
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] Extended the MamaDateTime C++ class with timespec get/set. (#282) mama/c_cpp/src/cpp/datetime.cpp mama/c_cpp/src/cpp/mama/MamaDateTime.h
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[noreply] Fixed issue with missing onSuccess declaration (#280) mama/jni/src/com/wombat/mama/examples/MamaPublisherJava.java mama/jni/src/com/wombat/mama/MamaPublisherCallback.java
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
OpenMAMA-6.2.1-rc1 Now Available
Frank Quinn <fquinn.ni@...>
Hi Folks, We are pleased to announce the first release candidate for openMAMA 6.2.1 is now available: This is a bugfix release to address a few main issues:
For a complete list of all 9 issues included in this release, please see here: https://github.com/OpenMAMA/OpenMAMA/milestone/7?closed=1 Thank you all in advance for your help in testing - if you spot any issues, please follow our guidelines for raising an issue, or even better, follow our guidelines for raising a patch. As this release is fairly small bugfix release, we're not expecting a large volume of bugs to fall out, so I will be acting on a reasonably brief test window of 1 week commencing today. If no issues have been found, we can aim to release on 29th May. If critical issues are found, we will continue to go through weekly release candidates until have a stable release ready. Cheers, Frank
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[Frank Quinn] Fixed build issue with windows scons builds mama/c_cpp/SConscript.win
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] Fix Win32 MamaPublisherTestC.EventSendWithCallbacks SEH exception. mama/c_cpp/src/gunittest/c/publishertest.cpp
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|
Code change(s) just landed on origin/next (Successful)
jenkins@...
Some changes have just been added to the origin/next branch!
[noreply] Fixed issue with date time on 32 bit linux (#275) mama/c_cpp/src/c/datetimeimpl.h mama/c_cpp/src/gunittest/c/mamadatetime/datetimetest.cpp mama/c_cpp/src/c/datetime.c
Results for OpenMAMA_Snapshot_Linux CI run with latest changes:
You may also check CI console output to view the full results.
|
|