[MacPorts] #40925: libboost (libstdc++) segfault on 10.9 Mavericks
#40925: libboost (libstdc++) segfault on 10.9 Mavericks -----------------------+-------------------------------- Reporter: wjngkoh@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.99 Keywords: | Port: -----------------------+-------------------------------- Hi all, I encountered a segfault error when I used boost::filesystem with gcc- mp-4.8. Both are installed via MacProts (ports gcc48 and boost.) After upgrading from Mountain Lion to Mavericks, I experienced this problem, so I just formatted my laptop and did clean install Mavericks and MacPorts from SVN again. However, the same problem still persists. Thus, I think it would be an actual bug rather than my mistake, and hope others can also reproduce this problem. Here is the lldb output of my example code: {{{ % lldb boost_test !244 Current executable set to 'boost_test' (x86_64). (lldb) run Process 7718 launched: '/tmp/boost_test' (x86_64) Process 7718 stopped * thread #1: tid = 0x729956, 0x000000010002fe29 libstdc++.6.dylib`__cxxabiv1::__si_class_type_info::__do_dyncast(long, __cxxabiv1::__class_type_info::__sub_kind, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info::__dyncast_result&) const + 35, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x9) frame #0: 0x000000010002fe29 libstdc++.6.dylib`__cxxabiv1::__si_class_type_info::__do_dyncast(long, __cxxabiv1::__class_type_info::__sub_kind, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info::__dyncast_result&) const + 35 libstdc++.6.dylib`__cxxabiv1::__si_class_type_info::__do_dyncast(long, __cxxabiv1::__class_type_info::__sub_kind, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info::__dyncast_result&) const + 35: -> 0x10002fe29: movq 8(%rcx), %rsi 0x10002fe2d: movq %r9, 16(%rsp) 0x10002fe32: movq 96(%rsp), %rbp 0x10002fe37: movq 104(%rsp), %r15 (lldb) list 6 int main() { 7 string src = "boost_test.cpp"; 8 string dst = "boost_test.cpp.bak"; 9 boost::filesystem::exists(dst); 10 boost::filesystem::remove(dst); 11 boost::filesystem::copy_file(src, dst); 12 } (lldb) }}} The example code I used in this testing is as follows: {{{ #include <iostream> #include <string> #include <boost/filesystem.hpp> using namespace std; int main() { string src = "boost_test.cpp"; string dst = "boost_test.cpp.bak"; boost::filesystem::exists(dst); boost::filesystem::remove(dst); boost::filesystem::copy_file(src, dst); } }}} and also Makefile. {{{ boost_test: boost_test.cpp g++-mp-4.8 -g -I/opt/local/include -L/opt/local/lib boost_test.cpp -lboost_filesystem-mt -lboost_system-mt -o boost_test }}} -- Ticket URL: <https://trac.macports.org/ticket/40925> MacPorts <http://www.macports.org/> Ports system for OS X
#40925: libboost (libstdc++) segfault on 10.9 Mavericks ------------------------+-------------------------------- Reporter: wjngkoh@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.99 Resolution: | Keywords: Port: | ------------------------+-------------------------------- Comment (by ryandesign@…): Is this the problem of mixing libc++ (which boost uses because it's compiled with the system compiler) with libstdc++ (which gcc48 uses)? You can't mix C++ runtimes... -- Ticket URL: <https://trac.macports.org/ticket/40925#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#40925: libboost (libstdc++) segfault on 10.9 Mavericks ------------------------+-------------------------------- Reporter: wjngkoh@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.99 Resolution: | Keywords: mavericks Port: | ------------------------+-------------------------------- Changes (by ryandesign@…): * keywords: => mavericks -- Ticket URL: <https://trac.macports.org/ticket/40925#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#40925: libboost (libstdc++) segfault on 10.9 Mavericks ------------------------+-------------------------------- Reporter: wjngkoh@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.99 Resolution: | Keywords: mavericks Port: | ------------------------+-------------------------------- Comment (by wjngkoh@…): Doesn't libc++ have ABI compatibility with libstdc++? I assumed it because I used the same source code in the exactly same way on 10.8 with MacPorts 2.2 and had no problem. Anyway, thanks for your comment ryandesign@ and I will try new libboost compiled by gcc 4.8 instead of the system-default CC. -- Ticket URL: <https://trac.macports.org/ticket/40925#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#40925: libboost (libstdc++) segfault on 10.9 Mavericks ------------------------+-------------------------------- Reporter: wjngkoh@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.99 Resolution: | Keywords: mavericks Port: | ------------------------+-------------------------------- Comment (by ryandesign@…): Replying to [comment:3 wjngkoh@…]:
Doesn't libc++ have ABI compatibility with libstdc++?
No. They are API-compatible, but not ABI-compatible.
I assumed it because I used the same source code in the exactly same way on 10.8 with MacPorts 2.2 without any problem.
OS X 10.9 Mavericks is the first version to use libc++; previous versions of OS X used libstdc++.
Anyway, thanks for your comment, ryandesign@. I will try new libboost compiled by gcc 4.8 instead of the system-default CC.
Instead, could you compile your code using the system compiler? That might be better. -- Ticket URL: <https://trac.macports.org/ticket/40925#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#40925: libboost (libstdc++) segfault on 10.9 Mavericks ------------------------+-------------------------------- Reporter: wjngkoh@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.99 Resolution: | Keywords: mavericks Port: | ------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:4 ryandesign@…]:
No. They are API-compatible, but not ABI-compatible.
To elaborate, my understanding is that the libstdc++ included with earlier versions of OS X was patched by Apple to use libc++abi, which is the same C++ ABI used by libc++. However, libstdc++ as installed by MacPorts uses its own C++ ABI, libsupc++. Thus, C++ code compiled with MacPorts’ GCC compilers is ABI-incompatible with C++ code compiled with Apple’s compilers. -- Ticket URL: <https://trac.macports.org/ticket/40925#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#40925: libboost (libstdc++) segfault on 10.9 Mavericks ------------------------+-------------------------------- Reporter: wjngkoh@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.99 Resolution: wontfix | Keywords: mavericks Port: | ------------------------+-------------------------------- Changes (by ryandesign@…): * status: new => closed * resolution: => wontfix -- Ticket URL: <https://trac.macports.org/ticket/40925#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts