[LLVMbugs] [Bug 14294] New: std::deque clear() (and destructor too) segfaults because begin() > end()

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 8 10:17:55 PST 2012


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

             Bug #: 14294
           Summary: std::deque clear() (and destructor too) segfaults
                    because begin() > end()
           Product: libc++
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: dan.eloff at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


It seems to me looking at it under the debugger, that the problem is somehow _i
(begin) starts further than _e (end) therefore _i is never equal to _e and the
loop continues until it segfaults. This is the problematic loop in file deque,
but obviously the problem is somewhere else.

template <class _Tp, class _Allocator>
void
__deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
{
    allocator_type& __a = __alloc();
    for (iterator __i = begin(), __e = end(); __i != __e; ++__i)

This is for a deque of pointers, so the problem is not in a user destructor.

-- 
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