'cout << "some str"' segfaults when called from dlopen'ed libraries (multiple
libraries calling cout).

Valgrind report:

==23756== Thread 25:
==23756== Invalid read of size 4
==23756==    at 0x40E59E5: std::basic_ostream<char, std::char_traits<char> >&
std::endl<char, std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&) (in
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==23756==    by 0x40E342E: std::ostream::operator<<(std::ostream&
(*)(std::ostream&)) (in
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==23756==    by 0x109F39E5: MMCombo::DoInit(OSystemEvent const&)
(MMCombo.cc:128)
==23756==    by 0x10A352CB: __start_module (MMComboStub.cc:238)
==23756==    by 0x805A82B: module_executor(void*) (helper.cc:40)
==23756==    by 0x40414BA: start_thread (in /lib/libpthread-2.5.so)
==23756==    by 0x42374DD: clone (in /lib/libc-2.5.so)
==23756==  Address 0xFFFFFFF4 is not stack'd, malloc'd or (recently) free'd
==23756== 
==23756== Process terminating with default action of signal 11 (SIGSEGV)
==23756==  Access not within mapped region at address 0xFFFFFFF4
==23756==    at 0x40E59E5: std::basic_ostream<char, std::char_traits<char> >&
std::endl<char, std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&) (in
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==23756==    by 0x40E342E: std::ostream::operator<<(std::ostream&
(*)(std::ostream&)) (in
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6.0.8)
==23756==    by 0x109F39E5: MMCombo::DoInit(OSystemEvent const&)
(MMCombo.cc:128)
==23756==    by 0x10A352CB: __start_module (MMComboStub.cc:238)
==23756==    by 0x805A82B: module_executor(void*) (helper.cc:40)
==23756==    by 0x40414BA: start_thread (in /lib/libpthread-2.5.so)
==23756==    by 0x42374DD: clone (in /lib/libc-2.5.so)


-- 
           Summary: 'cout  << str' segfaults
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nunoplopes at sapo dot pt
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32485

Reply via email to