[LLVMbugs] [Bug 11362] New: Undefined behavior in pop_heap_comp.pass.cpp

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Nov 12 01:27:30 PST 2011


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

             Bug #: 11362
           Summary: Undefined behavior in pop_heap_comp.pass.cpp
           Product: libc++
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: markus at trippelsdorf.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I was running the libcxx tests with gcc-4.7.0 and noticed:

 % c++ -std=c++11 pop_heap_comp.pass.cpp
 % ./a.out
*** glibc detected *** ./a.out: double free or corruption (out):
0x0000000002443010 ***

This is because of:
 std::pop_heap(ia, ia, std::greater<int>());
 delete [] ia;

(ia, ia) is not a valid range and will send the ia pointer to lala land.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list