Sending this again, since I hadnt subscribed before sending this email.
One suspicious candidate from further debugging is the results_collector singleton(just because it appears in the stack and because its a singleton)

On Tue, Feb 21, 2017 at 2:03 PM, anandram sundar <sundaranandram@gmail.com> wrote:
Hi,
    I recently wrote some tests using the Boost testing framework and everything was working fine until I used the intel MKL with my project. As soon as I started linking these libraries, the tests started failing with a segmentation fault. This happens after the test execution is done and when the cleanup is happening. Looking at what valgrind outputs, it seems like there is some memory being released which is invalid(not sure if it is because of calling free on already freed memory).  This actually happens even if none of the code depends on the MKL. Just adding them to the linked libraries is enough to cause this.

GCC 4.9.3
Boost ver 1.62

==85160== Invalid read of size 4
==85160==    at 0x10916C57: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /lib/libstdc++.so.6.0.20)
==85160==    by 0x1104AEBC: __cxa_finalize (in /lib64/libc-2.12.so)
==85160==    by 0x41981E2: ??? (in /lib/libboost_unit_test_framework.so.1.62.0)
==85160==    by 0x400EC5B: _dl_fini (in /lib64/ld-2.12.so)
==85160==    by 0x1104AB21: exit (in /lib64/libc-2.12.so)
==85160==    by 0x11033D63: (below main) (in /lib64/libc-2.12.so)
==85160==  Address 0x1262fab0 is 16 bytes inside a block of size 30 free'd
==85160==    at 0x4C26FD6: operator delete(void*) (vg_replace_malloc.c:480)
==85160==    by 0x1104AB21: exit (in /lib64/libc-2.12.so)
==85160==    by 0x11033D63: (below main) (in /lib64/libc-2.12.so)


==85160== Invalid free() / delete / delete[] / realloc()
==85160==    at 0x4C26FD6: operator delete(void*) (vg_replace_malloc.c:480)
==85160==    by 0x1104AEBC: __cxa_finalize (in /lib64/libc-2.12.so)
==85160==    by 0x41981E2: ??? (in /lib/libboost_unit_test_framework.so.1.62.0)
==85160==    by 0x400EC5B: _dl_fini (in /lib64/ld-2.12.so)
==85160==    by 0x1104AB21: exit (in /lib64/libc-2.12.so)
==85160==    by 0x11033D63: (below main) (in /lib64/libc-2.12.so)
==85160==  Address 0x1262faa0 is 0 bytes inside a block of size 30 free'd
==85160==    at 0x4C26FD6: operator delete(void*) (vg_replace_malloc.c:480)
==85160==    by 0x1104AB21: exit (in /lib64/libc-2.12.so)
==85160==    by 0x11033D63: (below main) (in /lib64/libc-2.12.so)


I am not sure why this is happening. Are there any known compatibility issues between MKL and Boost testing framework. I was using ACML before this and the tests were working fine with them.


Thanks,
Anand