Deadlock in mamaSubscription and mamaTransport destroy logic

Slade, Michael J

Hi OpenMAMA Dev,


We have encountered a deadlock situation in mamaSubscription’s and mamaTransport’s teardown logic due to lock ordering when destroying their underlying mamaPublisher. We are able to reliably reproduce this with the tick42 bridge. Could someone take a look at this for us please?

Thanks in advance,


Deadlock – note that subscription and transport attempt to destroy same publisher:
mamaTransport teardown:

1.      transport.c:         mamaTransport_destroy()

2.      transport.c:         mamaTransportImpl_clearTransportWithPublishers()

3.      list.c:                    list_for_each()Acquires list lock (1)

4.  transport.c:         mamaTransportImpl_clearTransportPublisherCallback()

5.  publisher.c:         mamaPublisherImpl_clearTransport()

6.      publisher.c:         mamaPublisherImpl_destroy()Attempts to acquire publisher lock (2)


mamaSubscription teardown

1.      subscription.c:    mamaSubscriptionImpl_onSubscriptionDestroyed()

2.      subscription.c:    mamaSubscription_cleanup()

3.      publisher.c:         mamaPublisherImpl_destroy()Acquires publisher lock (2)

4.      transport.c:         mamaTransport_removePublisher()

5.      list.c:                    list_remove_element()Attempts to acquire list lock (1)


This message is confidential and subject to terms at: including on confidential, privileged or legal entity information, 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.

Join to automatically receive all group messages.