[MacPorts] #42496: boost::thread join() crashes under Mountain Lion.

MacPorts noreply at macports.org
Thu Feb 13 09:23:37 PST 2014


#42496: boost::thread join() crashes under Mountain Lion.
-------------------------+--------------------------------
 Reporter:  trojanfoe@…  |      Owner:  macports-tickets@…
     Type:  defect       |     Status:  new
 Priority:  Normal       |  Milestone:
Component:  ports        |    Version:  2.2.1
 Keywords:               |       Port:  boost
-------------------------+--------------------------------
 I have boost-1.55.0_1 installed under Mavericks and Mountain Lion and the
 code (attached) crashes under Mountain Lion:

 {{{
 kraken:tmp $ uname -a
 Darwin kraken.trojanfoe.com 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep
 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
 kraken:tmp $ port info boost
 boost @1.55.0_1 (devel)
 Variants:             clang30, clang31, clang32, clang33, clang34,
 clang35,
                       debug, dragonegg30, dragonegg31, dragonegg32,
 dragonegg33,
                       dragonegg34, g95, gcc44, gcc45, gcc46, gcc47, gcc48,
                       gcc49, gfortran, llvm, mpich, mpich_devel,
 [+]no_single,
                       [+]no_static, openmpi, openmpi_devel, python25,
 python26,
                       [+]python27, python31, python32, python33,
                       regex_match_extra, universal

 Description:          Boost provides free portable peer-reviewed C++
 libraries.
                       The emphasis is on portable libraries which work
 well with
                       the C++ Standard Library.
 Homepage:             http://www.boost.org

 Library Dependencies: zlib, expat, bzip2, libiconv, icu, python27
 Platforms:            darwin
 License:              Boost-1
 Maintainers:          nomaintainer at macports.org
 kraken:tmp $ clang --version
 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
 Target: x86_64-apple-darwin12.5.0
 Thread model: posix
 kraken:tmp $ clang++ -std=c++11 -stdlib=libc++ -I /opt/local/include -o
 threadtest threadtest.cpp -L /opt/local/lib -lboost_system-mt
 -lboost_thread-mt
 kraken:tmp $ lldb threadtest
 Current executable set to 'threadtest' (x86_64).
 (lldb) run
 Process 61735 launched: '/Users/andy/tmp/threadtest' (x86_64)
 starting
 enter thread
 exit thread
 Process 61735 stopped
 * thread #1: tid = 0x230b7b, 0x000000010004e725 libboost_thread-
 mt.dylib`boost::detail::thread_data_base::~thread_data_base() + 181, queue
 = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1,
 address=0x1)
     frame #0: 0x000000010004e725 libboost_thread-
 mt.dylib`boost::detail::thread_data_base::~thread_data_base() + 181
 libboost_thread-
 mt.dylib`boost::detail::thread_data_base::~thread_data_base() + 181:
 -> 0x10004e725:  movq   (%r13), %rbx
    0x10004e729:  leaq   56(%rbx), %rax
    0x10004e72d:  movq   %rax, -56(%rbp)
    0x10004e731:  movb   $0, -48(%rbp)
 (lldb) bt
 * thread #1: tid = 0x230b7b, 0x000000010004e725 libboost_thread-
 mt.dylib`boost::detail::thread_data_base::~thread_data_base() + 181, queue
 = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1,
 address=0x1)
     frame #0: 0x000000010004e725 libboost_thread-
 mt.dylib`boost::detail::thread_data_base::~thread_data_base() + 181
     frame #1: 0x000000010000b685
 threadtest`boost::detail::thread_data<boost::_bi::bind_t<void,
 boost::_mfi::mf0<void, Test>, boost::_bi::list1<boost::_bi::value<Test*> >
 > >::~thread_data() + 21
     frame #2: 0x000000010000a495
 threadtest`boost::detail::thread_data<boost::_bi::bind_t<void,
 boost::_mfi::mf0<void, Test>, boost::_bi::list1<boost::_bi::value<Test*> >
 > >::~thread_data() + 21
     frame #3: 0x000000010000a4b9
 threadtest`boost::detail::thread_data<boost::_bi::bind_t<void,
 boost::_mfi::mf0<void, Test>, boost::_bi::list1<boost::_bi::value<Test*> >
 > >::~thread_data() + 25
     frame #4: 0x000000010000c5ae threadtest`void
 boost::checked_delete<boost::detail::thread_data<boost::_bi::bind_t<void,
 boost::_mfi::mf0<void, Test>, boost::_bi::list1<boost::_bi::value<Test*> >
 > > >(boost::detail::thread_data<boost::_bi::bind_t<void,
 boost::_mfi::mf0<void, Test>, boost::_bi::list1<boost::_bi::value<Test*> >
 > >*) + 46
     frame #5: 0x000000010000c6a9
 threadtest`boost::detail::sp_counted_impl_p<boost::detail::thread_data<boost::_bi::bind_t<void,
 boost::_mfi::mf0<void, Test>, boost::_bi::list1<boost::_bi::value<Test*> >
 > > >::dispose() + 25
     frame #6: 0x000000010004f2af libboost_thread-
 mt.dylib`boost::thread::join_noexcept() + 447
     frame #7: 0x00000001000027f4 threadtest`boost::thread::join() + 148
     frame #8: 0x000000010000157d threadtest`Test::test() + 589
     frame #9: 0x0000000100001741 threadtest`main + 33
     frame #10: 0x00007fff86cea7e1 libdyld.dylib`start + 1
 (lldb) quit
 Quitting LLDB will kill one or more processes. Do you really want to
 proceed: [Y/n] y
 kraken:tmp $

 }}}

 Note that the same code works flawlessly under Mavericks:


 {{{
 medusa:tmp $ uname -a
 Darwin medusa.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19
 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
 medusa:tmp $ port info boost
 boost @1.55.0_1 (devel)
 Variants:             clang30, clang31, clang32, clang33, clang34,
 clang35,
                       debug, dragonegg30, dragonegg31, dragonegg32,
 dragonegg33,
                       dragonegg34, g95, gcc44, gcc45, gcc46, gcc47, gcc48,
                       gcc49, gfortran, llvm, mpich, mpich_devel,
 [+]no_single,
                       [+]no_static, openmpi, openmpi_devel, python25,
 python26,
                       [+]python27, python31, python32, python33,
                       regex_match_extra, universal

 Description:          Boost provides free portable peer-reviewed C++
 libraries.
                       The emphasis is on portable libraries which work
 well with
                       the C++ Standard Library.
 Homepage:             http://www.boost.org

 Library Dependencies: zlib, expat, bzip2, libiconv, icu, python27
 Platforms:            darwin
 License:              Boost-1
 Maintainers:          nomaintainer at macports.org
 medusa:tmp $ clang --version
 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
 Target: x86_64-apple-darwin13.0.0
 Thread model: posix
 medusa:tmp $ clang++ -std=c++11 -stdlib=libc++ -I /opt/local/include -o
 threadtest threadtest.cpp -L /opt/local/lib -lboost_system-mt
 -lboost_thread-mt
 medusa:tmp $ lldb threadtest
 Current executable set to 'threadtest' (x86_64).
 (lldb) run
 Process 55929 launched: '/Users/andy/tmp/threadtest' (x86_64)
 starting
 enter thread
 exit thread
 finishing
 Process 55929 exited with status = 0 (0x00000000)
 (lldb) quit
 medusa:tmp $

 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/42496>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list