Re: Two Mamda libraries exporting the same symbol
Frank Quinn
Hi Mike,
This isn’t something that I have seen before but it does look like a bug to me… and one which I imagine you had all sorts of fun tracking down.
On the upside, it looks like the struct in question isn’t referenced in the public headers so at least it can be renamed in relative isolation. Is this something that you are in the progress of doing or you want me to have a look?
I have raised https://github.com/OpenMAMA/OpenMAMA/issues/392 for tracking.
Cheers, Frank
From: Openmama-dev@... <Openmama-dev@...>
On Behalf Of Slade, Michael J via Lists.Openmama.Org
Sent: 26 April 2019 09:23 To: Openmama-dev@... Cc: Openmama-dev@... Subject: [Openmama-dev] Two Mamda libraries exporting the same symbol
Hi all,
We have noticed that both mamda/c_cpp/src/cpp/MamdaQuoteListener.cpp and mamda/c_cpp/src/orderbooks/MamdaQuoteToBookListener have implementations of a QuoteCache struct in the Wombat namespace. Therefore, both libmamda and libmamdabook are exporting the same symbol.
This is an issue when linking against the two libraries since the order they are dynamically linked determines which one is used. If the wrong QuoteCache struct is used this causes a segfault during construction of the object as the two implementations are different.
To me this seems like a bug and one of the two QuoteCache structs should be renamed.
Has anyone had an issue with this before / can anyone shed some light on this?
Thanks,
Mike Slade | Corporate & Investment Bank | Market Data Services | J.P. Morgan
This message is confidential and subject to terms at: https://www.jpmorgan.com/emaildisclaimer including on confidentiality, legal privilege, viruses and monitoring of electronic messages. If you are not the intended recipient, please delete this message and notify the sender immediately. Any unauthorized use is strictly prohibited. |
|
Two Mamda libraries exporting the same symbol
Slade, Michael J
Hi all,
We have noticed that both mamda/c_cpp/src/cpp/MamdaQuoteListener.cpp and mamda/c_cpp/src/orderbooks/MamdaQuoteToBookListener have implementations of a QuoteCache struct in the Wombat namespace. Therefore, both libmamda and libmamdabook are exporting the same symbol.
This is an issue when linking against the two libraries since the order they are dynamically linked determines which one is used. If the wrong QuoteCache struct is used this causes a segfault during construction of the object as the two implementations are different.
To me this seems like a bug and one of the two QuoteCache structs should be renamed.
Has anyone had an issue with this before / can anyone shed some light on this?
Thanks,
Mike Slade | Corporate & Investment Bank | Market Data Services | J.P. Morgan
This message is confidential and subject to terms at: https://www.jpmorgan.com/emaildisclaimer including on confidentiality, legal privilege, viruses and monitoring of electronic messages. If you are not the intended recipient, please delete this message and notify the sender immediately. Any unauthorized use is strictly prohibited. |
|
Code change(s) just landed on origin/next (Successful)
ci@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] Restored conditional in listenermsgcallback.c mama/c_cpp/src/c/listenermsgcallback.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 (Still Failing)
ci@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] Restored conditional in listenermsgcallback.c mama/c_cpp/src/c/listenermsgcallback.c
Results for OpenMAMA_Snapshot_Windows CI run with latest changes:
You may also check CI console output to view the full results. |
|
Re: change openmama linux platform implementation to call dlopen with RTLD_LOCAl flag
Igor Kovalenko
Classification: Public Thank you Frank,
I confirm changing the dlopen() call to use RTLD_LOCAL fixes the problem for us here, none of our tests are otherwise affected. Have not looked at split-bridge changes yet but I’m sure that is a good thing to have.
-- Kind regards,
From: Openmama-dev@... [mailto:Openmama-dev@...]
On Behalf Of Frank Quinn
Sent: 15 января 2019 г. 13:11 To: Igor Kovalenko <igor.kovalenko@...> Cc: openmama-dev@... Subject: Re: [Openmama-dev] change openmama linux platform implementation to call dlopen with RTLD_LOCAl flag
Hi Igor,
Yes I'm open to the suggestion I can't see any negative side effects of this.
As an aside, the new split-bridge changes will also fix your timerheap issue since each bridge will have its own distinct heap allocated object in each bridge if it's used and would be best practice overall since it isolates each bridge and doesn't depend on static externs.
Cheers, Frank
On Jan 15 2019, at 10:03 am, Igor Kovalenko <igor.kovalenko@...> wrote:
--- 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. |
|
Re: change openmama linux platform implementation to call dlopen with RTLD_LOCAl flag
Frank Quinn
Hi Igor,
Yes I'm open to the suggestion I can't see any negative side effects of this.
As an aside, the new split-bridge changes will also fix your timerheap issue since each bridge will have its own distinct heap allocated object in each bridge if it's used and would be best practice overall since it isolates each bridge and doesn't depend
on static externs.
Cheers,
Frank
On Jan 15 2019, at 10:03 am, Igor Kovalenko <igor.kovalenko@...> wrote:
|
|
change openmama linux platform implementation to call dlopen with RTLD_LOCAl flag
Igor Kovalenko
Classification: Public Hi openmama team,
I see that on linux platform openmama uses dlopen() with RTLD_GLOBAL flag to load bridge implementations. What do you think about changing that dlopen() call to use RTLD_LOCAL instead? Using dlopen() with RTLD_LOCAL naturally provides named symbol isolation behavior one would expect from a system which dynamically loads implementations.
I cannot post a patch here yet but otherwise it is a trivial change to src/common/c_cpp/src/c/linux/platform.c line 65
Using RTLD_GLOBAL creates a problem if any two bridge implementations provide the same global symbol name. If loaded simultaneously these will share the same underlying object resolved through the library loaded first. For instance a crash can be reproduced with just loading tick42blp and tick42rmds bridges, and then closing mama. While mama is closing first bridge shutting down will destroy gTimerHeap object, and then last bridge shutting down will attempt to destroy the same gTimerHeap once again.
A workaround would be to carefully examine non-local symbols from each bridge implementation and fix accordingly if bridge sources are available. We can amend either blp or rmds bridge implementation - but this is not always possible and is obviously very inconvenient.
Note that on windows platform implementation already is behaving as non-global due to the fact that you always need explicitly loaded library handle to resolve a symbol.
Thank you!
-- Kind regards,
--- 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. |
|
OpenMAMA Simplified Base Middleware Bridge Implementation
Frank Quinn
Hi Folks,
As you may have heard recently, we have been working on reducing the burden of implementing each of the middleware bridge methods when
writing bridges.
The solution we're working on involves:
1. Adding a "base" implementation bridge. This includes io, timer and queue as well as some sane default implementations of methods. This
will be dynamically linked by the bridge that wants to make use of the base implementation.
2. The base bridge includes timer, queue and io implementations which will be modified to ensure they're properly encapsulated across middleware
bridges (i.e. heap allocated state associated with each bridge).
3. The implementation bridge may then simply declare in its init function that it wants to make use of the base implementaion bridge, then
any method which is not implemented by the bridge itself will fall back to the base bridge implementation.
4.
Reducing the number of methods which need to be implemented in the bridge from 86 to 20
It's basically inheritance for C structs of function pointers.
You can find the latest development branch here:
We have an implementation currently working with ZeroMQ, and will be updating qpid to support it soon too. It mostly involves migrating
methods to the base implementation to avoid duplication.
In the next release this will bump the middle part of the version number (which reflects bridge compatibility). This is because although
it is entirely backwards compatible, bridges making use of this functionality will not be backwards compatible.
Cheers,
Frank
--
Frank Quinn
Cascadium
T: +44 (0) 28 8678 8015
|
|
Re: openmama 6.2 crash with dqstrategy disabled for subscription with multiple initials [I]
Igor Kovalenko
Classification: For internal use only Thank you Aaron, I will give your suggestion a try.
To reproduce the issue you will need a transport returning multiple initial snapshots for your group subscription. Without that conditional I was referring to and with DQ strategy disabled crash will happen handling second snapshot from the group.
-- Kind regards,
From: Aaron Sneddon [mailto:asneddon@...]
Sent: 18 декабря 2018 г. 17:06 To: Igor Kovalenko <igor.kovalenko@...>; Frank Quinn <fquinn@...>; openmama-dev@... Cc: Gary Molloy <gmolloy@...>; Philip McCausland <pmccausland@...> Subject: FW: [Openmama-dev] openmama 6.2 crash with dqstrategy disabled for subscription with multiple initials
Hey Igor, I tried the various config options to reproduce the issue (as there are transport specific and global config options for disabling dq strategy). With regards to the missing conditional:
I can see that around the line of the change we have taken out the following conditional which I assume you are referring to:
I would just point out that this conditional statement hasn’t been removed, but was relocated to
mamaPlugin_fireSubscriptionPreMsgHook.
I cannot recommend duplicating the conditional statement, as this would be unnecessary and as I cannot reproduce your issue I can only make a suggestion that hopefully you could try?
At present mamaPlugin_fireSubscriptionPreMsgHook returns MAMA_STATUS_OK in all cases. My suggestion is, in dqstrategyplugin.c, at line 478, change MAMA_STATUS_OK
to MAMA_STATUS_INVALID_ARG (for example). { return; }
This would now emulate the previous functionality (but does not duplicate the conditional).
I have done this myself and performed a quick check that it does not break anything and it looks fine. But as I say, I cannot replicate your issue and so cannot do a full check. I would therefore say that if it suits, you could change that single line in dqstrategyplugin.c and add the check in listenermsgcallback, and run a test to see if this fixes your issue.
I am still concerned as to why I cannot reproduce the same issue, but please let me know what you think.
Regards, Aaron
From: Frank Quinn [mailto:fquinn@...]
Aaron / Vela, could someone have a look please?
On 12 Nov 2018 19:36, Frank Quinn <frank@...> wrote:
--- 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. |
|
Re: openmama 6.2 crash with dqstrategy disabled for subscription with multiple initials
Frank Quinn
Aaron / Vela, could someone have a look please? On 12 Nov 2018 19:36, Frank Quinn <frank@...> wrote:
|
|
Code change(s) just landed on origin/next (Successful)
ci@...
Some changes have just been added to the origin/next branch!
[noreply] Add cross platform docker builds (#388) release_scripts/install-dependencies.sh mama/c_cpp/src/c/dictionary.c .appveyor.yml common/c_cpp/src/gunittest/c/CMakeLists.txt release_scripts/ci-run.py mama/c_cpp/src/c/fielddesc.c common/c_cpp/src/gunittest/c/strutilstest.cpp mama/c_cpp/src/c/CMakeLists.txt cmake/FindAPR.cmake release_scripts/Dockerfile
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 (Still Failing)
ci@...
Some changes have just been added to the origin/next branch!
[noreply] Add cross platform docker builds (#388) common/c_cpp/src/gunittest/c/strutilstest.cpp .appveyor.yml release_scripts/ci-run.py release_scripts/install-dependencies.sh mama/c_cpp/src/c/fielddesc.c cmake/FindAPR.cmake release_scripts/Dockerfile mama/c_cpp/src/c/CMakeLists.txt mama/c_cpp/src/c/dictionary.c common/c_cpp/src/gunittest/c/CMakeLists.txt
Results for OpenMAMA_Snapshot_Windows CI run with latest changes:
You may also check CI console output to view the full results. |
|
OpenMAMA_Snapshot_RPM - Build # 643 - Failure!
ci@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] PLAT-1474: getNumBidLevels and getNumAskLevels wrong on some occasions mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBookListener.cpp
Results for OpenMAMA_Snapshot_RPM 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)
ci@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] PLAT-1474: getNumBidLevels and getNumAskLevels wrong on some occasions mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBookListener.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 (Still Failing)
ci@...
Some changes have just been added to the origin/next branch!
[fquinn.ni] PLAT-1474: getNumBidLevels and getNumAskLevels wrong on some occasions mamda/c_cpp/src/cpp/orderbooks/MamdaOrderBookListener.cpp
Results for OpenMAMA_Snapshot_Windows CI run with latest changes:
You may also check CI console output to view the full results. |
|
Re: openmama 6.2 crash with dqstrategy disabled for subscription with multiple initials
Thanks Igor, This was part of Vela's DQ strategy changes - Aaron could you have a look please? Cheers, Frank On Mon, Nov 12, 2018 at 1:32 PM Igor Kovalenko <igor.kovalenko@...> wrote:
|
|
openmama 6.2 crash with dqstrategy disabled for subscription with multiple initials
Igor Kovalenko
Classification: Public Hi openmama team,
I see that commit 6de60350f40b4d9b0f181b7e64e0d192798b9f97 accidentally removed one conditional expression from around current line 393 of listenermsgcallbacks.c
Now if group subscription, or in fact any allowing multiple initials, receives first initial, then - with dqstrategy disabled listenerMsgCallback_processMsg will unconditionally call mamaSubscription_stopWaitForResponse - with dqstrategy enabled dqstrategy plugin implementation would only call mamaSubscription_stopWaitForResponse if mamaSubscription_getAcceptMultipleInitials() returns false
The code that stops waiting for response destroys related inbox object. This leads to easy crash with group subscriptions and dqstrategy disabled.
Hope it will be not hard to restore the conditional for openmama-6.2.x and later.
Thank you!
Kind regards, Igor Kovalenko
--
--- 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)
ci@...
Some changes have just been added to the origin/next branch!
[noreply] Added initial docker files for performing builds (#385) mama/c_cpp/src/examples/c/CMakeLists.txt mama/CMakeLists.txt mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c mama/jni/src/CMakeLists.txt mama/c_cpp/src/examples/cpp/mamamsgpublishercpp.cpp mama/c_cpp/src/testtools/performance/c/CMakeLists.txt mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c mamda/c_cpp/src/examples/orderbooks/CMakeLists.txt mamda/java/CMakeLists.txt release_scripts/install-dependencies.sh mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c release_scripts/build-package.sh mama/c_cpp/src/examples/cpp/CMakeLists.txt .dockerignore mama/c_cpp/src/testtools/performance/c/mamaproducerc.c release_scripts/Dockerfile CMakeLists.txt cmake/mama-common.cmake mamda/c_cpp/src/examples/CMakeLists.txt
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 (Failure)
ci@...
Some changes have just been added to the origin/next branch!
[noreply] Added initial docker files for performing builds (#385) mama/c_cpp/src/examples/c/CMakeLists.txt mama/c_cpp/src/examples/cpp/mamamsgpublishercpp.cpp CMakeLists.txt .dockerignore mamda/java/CMakeLists.txt mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c mama/c_cpp/src/testtools/performance/c/CMakeLists.txt release_scripts/Dockerfile mama/c_cpp/src/testtools/performance/c/mamaproducerc.c cmake/mama-common.cmake mama/CMakeLists.txt mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c mamda/c_cpp/src/examples/orderbooks/CMakeLists.txt release_scripts/build-package.sh mama/c_cpp/src/examples/cpp/CMakeLists.txt mamda/c_cpp/src/examples/CMakeLists.txt mama/jni/src/CMakeLists.txt release_scripts/install-dependencies.sh
Results for OpenMAMA_Snapshot_Windows CI run with latest changes:
You may also check CI console output to view the full results. |
|
Changes to OpenMAMA CI / Pull Request Checks
Frank Quinn
Hi Folks,
There were some compiler warnings that crept in recently in the MAMDA area that I didn't notice at code review time because travis / appveyor builds don't currently fail on warning. Instead, the warning is only reported when the PR is merged into next
and the Jenkins CI environment picks it up. I've come back and cleaned these up myself as part of these changes.
With this in mind I have made the following changes to the automatic PR code check systems:
1. I have retired travis. Appveyor now supports Ubuntu as well as Windows builds anyway (and more recent versions of Linux than Travis supports so you generally benefit from stricter gcc warnings). This means there's no longer any compelling reason to
support both systems so I've turned travis off.
2. I have updated the build system to include -Werror so CI will now fail in the event of a compiler warning being produced.
3. Linux test builds now use cmake rather than scons. Note the next release will have scons removed so please try it out in your local builds.
Note that I would have also modified valgrind to report on compiler warning but ubuntu looks like it currently reports errors that arent present on centos but that's a fight for another day, so I held fire on that one.
Cheers,
Frank
--
Frank Quinn
Cascadium
T: +44 (0) 28 8678 8015
E: fquinn@...
|
|