[LLVMbugs] [Bug 15337] New: Crash when destructing object from class deriving from std::ostream (using default constructor)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 22 19:16:30 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15337

            Bug ID: 15337
           Summary: Crash when destructing object from class deriving from
                    std::ostream (using default constructor)
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: duvan.llvm at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Reduced test case:
Testcase:

#include <ostream>

struct Stream : public std::ostream {
    Stream() : std::ostream() {}
};

int main() {
    Stream crash;
    return 0;
}

The code was compiled with clang 3.2 on Macos Snow Leopard. The libc++ used was
svn version r175274.

Valgrind stack trace (although from a little more involved case as valgrind
crashes on the above case).

==11856==    at 0x100066761:
std::__1::ios_base::__call_callbacks(std::__1::ios_base::event) (in
/Users/sduvan/Code/libcxx/lib/libc++.1.dylib)
==11856==    by 0x100066711: std::__1::ios_base::~ios_base() (in
/Users/sduvan/Code/libcxx/lib/libc++.1.dylib)
==11856==    by 0x100017671: std::__1::unique_ptr<Log,
std::__1::default_delete<Log> >::~unique_ptr() (in /Users/sduvan/test)
==11856==    by 0x100198373: __cxa_finalize (in /usr/lib/libSystem.B.dylib)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130223/220d9674/attachment.html>


More information about the llvm-bugs mailing list