Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGV in OpenMAMA unit tests w/base bridge #7

Open
bill-torpey opened this issue Nov 9, 2021 · 0 comments
Open

SEGV in OpenMAMA unit tests w/base bridge #7

bill-torpey opened this issue Nov 9, 2021 · 0 comments

Comments

@bill-torpey
Copy link
Collaborator

OpenMAMA: base bridge makes assumptions about transport

The OpenMAMA base bridge implementation of the IO object assumes that the transport defines and allocates a "closure" object that:

  • is returned by the (poorly-named) baseBridgeMamaIoImpl_getQpidBridgeClosure function;
  • includes a pointer to a baseBridgeClosure struct that in turn contains a pointer to a event_base struct which is used by the IO component.

While the official Bridge documentation appears to mandate a "closure" object for any transport, the official Qpid bridge does not allocate one, and neither did OZ. That worked OK for the Qpid bridge, since it does not delegate to the base bridge implementation. (One can argue that the Qpid bridge should have been modified to delegate to the base bridge when the base bridge implementation was created, but that did not happen).

However, since the OZ bridge did delegate to the base bridge implementation, but did not set the bridge closure, the unit tests resulted in the following SEGV:

==1167625==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x7fd2a2cb78f9 bp 0x7ffc7c177300 sp 0x7ffc7c1771e0 T0)
==1167625==The signal is caused by a READ memory access.
==1167625==Hint: address points to the zero page.
    #0 0x7fd2a2cb78f9 in baseBridgeMamaIo_create /home/btorpey/work/OpenMAMA/master/src/mama/c_cpp/src/c/bridge/base/io.c:113:45
    #1 0x7fd2a60d5cd5 in mamaIo_create /home/btorpey/work/OpenMAMA/master/src/mama/c_cpp/src/c/io.c:86:33
    #2 0x5a3483 in MamaIoTestC_CreateDestroy_Test::TestBody() /home/btorpey/work/OpenMAMA/master/src/mama/c_cpp/src/gunittest/c/iotest.cpp:93:26
    #3 0x7fcc2c in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:2402
    #4 0x7f74a1 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:2438
    #5 0x7dcbb9 in testing::Test::Run() /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:2475
    #6 0x7dd429 in testing::TestInfo::Run() /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:2656
    #7 0x7dda63 in testing::TestCase::Run() /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:2774
    #8 0x7e4586 in testing::internal::UnitTestImpl::RunAllTests() /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:4649
    #9 0x7fdab2 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:2402
    #10 0x7f81bb in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:2438
    #11 0x7e328b in testing::UnitTest::Run() /shared/buildtest/googletest/1.8.0-gcc530/googletest-release-1.8.0/googletest/src/gtest.cc:4257
    #12 0x7d593e in RUN_ALL_TESTS() /build/share/googletest/1.8.0-gcc530/include/gtest/gtest.h:2233:46
    #13 0x7d593e in main /home/btorpey/work/OpenMAMA/master/src/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp:181:12
    #14 0x7fd2a5a220b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    #15 0x4f528d in _start (/home/btorpey/install/OpenMAMA/master/asan/bin/UnitTestMamaC+0x4f528d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/btorpey/work/OpenMAMA/master/src/mama/c_cpp/src/c/bridge/base/io.c:113:45 in baseBridgeMamaIo_create
==1167625==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant