Changes between Initial Version and Version 1 of Ticket #35770, comment 2


Ignore:
Timestamp:
Sep 19, 2012, 6:53:58 AM (12 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35770, comment 2

    initial v1  
    22> Several libstdc++ do not coexist well inside one process. I get backtraces like that when compiling with macports gcc46:
    33>
    4 {{{
    5 malloc: *** error for object 0x10151e500: pointer being freed was not allocated
    6 
    7 #0  0x00007fff8eddf588 in malloc_error_break ()
    8 #1  0x00007fff8ede0942 in free ()
    9 #2  0x00007fff90154cf5 in std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow ()
    10 #3  0x00007fff9015898e in std::basic_streambuf<char, std::char_traits<char> >::xsputn ()
    11 #4  0x00000001014a8b45 in std::__ostream_insert<char, std::char_traits<char> > ()
    12 #5  0x00007fff7d9a7b80 in vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> > ()
    13 #6  0x00007fff90155c8e in std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream ()
    14 #7  0xed851f90058d48fb in ?? ()
    15 }}}
     4> {{{
     5> malloc: *** error for object 0x10151e500: pointer being freed was not allocated
     6>
     7> #0  0x00007fff8eddf588 in malloc_error_break ()
     8> #1  0x00007fff8ede0942 in free ()
     9> #2  0x00007fff90154cf5 in std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow ()
     10> #3  0x00007fff9015898e in std::basic_streambuf<char, std::char_traits<char> >::xsputn ()
     11> #4  0x00000001014a8b45 in std::__ostream_insert<char, std::char_traits<char> > ()
     12> #5  0x00007fff7d9a7b80 in vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> > ()
     13> #6  0x00007fff90155c8e in std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream ()
     14> #7  0xed851f90058d48fb in ?? ()
     15> }}}
    1616> 0x00007fff addresses are from system /usr/lib/libstdc++.dylib and 0x00000001 are from gcc's libstdc++. Two things are wrong here - they call each others functions and they try to free each others objects/memory regions. Basicly it's completely broken behaviour. It's a wonder that crashes happen so rarely.
    1717> Since there are system frameworks/libraries that are linked against /usr/lib/libstdc++ (and libc++, and libobjc), macports compilers should use system libstdc++ too and not include their own version of C++ runtime library.