Boost C++ Libraries: Ticket #7512: Boost.Test segmentation fault when built with clang on Mac OS X. https://svn.boost.org/trac10/ticket/7512 <p> Mac OS X 10.8.2, Xcode 4.5.1 </p> <p> $ clang -v Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn) Target: x86_64-apple-darwin12.2.0 Thread model: posix </p> <p> Boost is built with clang without -std=c++11. </p> <p> The problem is shown below: </p> <pre class="wiki">$ cat boost_test_segfault.cc #define BOOST_TEST_MODULE test #include &lt;boost/test/included/unit_test.hpp&gt; BOOST_AUTO_TEST_CASE( test1 ) { BOOST_CHECK(true); } $ clang++ -g -Wall -I/opt/homebrew/include boost_test_segfault.cc -L/opt/homebrew/lib -lboost_unit_test_framework-mt In file included from boost_test_segfault.cc:3: In file included from /opt/homebrew/include/boost/test/included/unit_test.hpp:20: In file included from /opt/homebrew/include/boost/test/impl/framework.ipp:29: In file included from /opt/homebrew/include/boost/test/test_tools.hpp:21: /opt/homebrew/include/boost/test/floating_point_comparison.hpp:251:25: warning: unused variable 'check_is_close' [-Wunused-variable] check_is_close_t const&amp; check_is_close = unit_test::ut_detail::static_constant&lt;check_is_close_t&gt;::value; ^ /opt/homebrew/include/boost/test/floating_point_comparison.hpp:273:25: warning: unused variable 'check_is_small' [-Wunused-variable] check_is_small_t const&amp; check_is_small = unit_test::ut_detail::static_constant&lt;check_is_small_t&gt;::value; ^ 2 warnings generated. $ ./a.out Running 1 test case... Segmentation fault: 11 </pre><p> A detailed gdb session with "bt full" is attached. </p> <p> Also, on a relevant post on stackoverflow (<a class="ext-link" href="http://stackoverflow.com/questions/12695625/boost-test-crashes-on-exit-with-clang-4-1-llvm-3-1svn"><span class="icon">​</span>http://stackoverflow.com/questions/12695625/boost-test-crashes-on-exit-with-clang-4-1-llvm-3-1svn</a>) the user tried with building boost using clang with -std=c++11 -stdlib=libc++ and compile the test code with the same flag and the executable doesn't crash anymore. But I haven't tested that. I also tried to build the test program with llvm g++, but it runs with the same error. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7512 Trac 1.4.3 manphiz@… Tue, 16 Oct 2012 10:24:25 GMT attachment set https://svn.boost.org/trac10/ticket/7512 https://svn.boost.org/trac10/ticket/7512 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">gdb.log</span> </li> </ul> Ticket manphiz@… Mon, 22 Oct 2012 19:32:12 GMT <link>https://svn.boost.org/trac10/ticket/7512#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7512#comment:1</guid> <description> <p> After some testings, it looks like all compilers on Mac OS X (apple-gcc 4.2.1, llvm-gcc 4.2.1, clang 4.1) are affected. </p> </description> <category>Ticket</category> </item> <item> <author>manphiz@…</author> <pubDate>Thu, 25 Oct 2012 02:50:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7512#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7512#comment:2</guid> <description> <p> OK, it seems that I'm not using it right. It seems that at least on Mac OS X one should just use dynamic library or single header, but not both at the same time. Using each flavor the test program runs just fine. So please feel free to close this ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Gennadiy Rozental</dc:creator> <pubDate>Mon, 05 Nov 2012 02:36:36 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7512#comment:3 https://svn.boost.org/trac10/ticket/7512#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> Ticket