[LLVMbugs] [Bug 5382] New: error: elements in iterator range [ __first, __last) do not form a heap

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Nov 3 08:46:57 PST 2009


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

           Summary: error: elements in iterator range [     __first, __last)
                    do not form a heap
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


I get the crash below in a clang build with expensive checks.

NOTE: I turned on expensive checks just now.  Possibly this will result in more
reports like this.  If these are annoying just let me know...

regehr at john-home:~/volatile/tmp222$ clang -v
clang version 1.1 (trunk 85862)
Target: i386-pc-linux-gnu
Thread model: posix
regehr at john-home:~/volatile/tmp222$ clang -O small.c
small.c:3:34: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
unsigned char func_2 (short p_3, int8p_4, unsigned char p_5, int8p_6);
                                 ^
small.c:3:62: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
unsigned char func_2 (short p_3, int8p_4, unsigned char p_5, int8p_6);
                                                             ^
small.c:12:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/usr/include/c++/4.4/bits/stl_heap.h:357:error: elements in iterator range [
    __first, __last) do not form a heap with respect to the predicate __comp    
    .

Objects involved in the operation:
iterator "__first" @ 0x0xbfb87478 {
type =
N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPPN4llvm5SUnitENSt6__norm6vectorIS5_SaIS5_EEEEENSt7__debug6vectorIS5_S9_EEEE
(mutable iterator);
  state = dereferenceable (start-of-sequence);
  references sequence with type `NSt7__debug6vectorIPN4llvm5SUnitESaIS3_EEE' @
0x0xbfb87478
}
iterator "__last" @ 0x0xbfb87464 {
type =
N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPPN4llvm5SUnitENSt6__norm6vectorIS5_SaIS5_EEEEENSt7__debug6vectorIS5_S9_EEEE
(mutable iterator);
  state = past-the-end;
  references sequence with type `NSt7__debug6vectorIPN4llvm5SUnitESaIS3_EEE' @
0x0xbfb87464
}
0  clang-cc       0x09402cbb
1  clang-cc       0x09402af2
2                 0x00adf400 __kernel_sigreturn + 0
3  libc.so.6      0x0015b932 abort + 386
4  libstdc++.so.6 0x004cc1c2 __gnu_debug::_Error_formatter::_M_error() const +
370
5  clang-cc       0x08e768cb
6  clang-cc       0x08e7579c
7  clang-cc       0x08e73b7c
8  clang-cc       0x08e70997
9  clang-cc       0x08e6dc3f
10 clang-cc       0x08f98450
11 clang-cc       0x08e780df
12 clang-cc       0x08e0d0f5
13 clang-cc       0x08e0bb94
14 clang-cc       0x08e0ddaf
15 clang-cc       0x08e0b641
16 clang-cc       0x08f31f83
17 clang-cc       0x09358748
18 clang-cc       0x09358492
19 clang-cc       0x09358111
20 clang-cc       0x0808bd5e
21 clang-cc       0x0808b186
22 clang-cc       0x08398a7a
23 clang-cc       0x08058ca8
24 clang-cc       0x0805a55e main + 4010
25 libc.so.6      0x00144b56 __libc_start_main + 230
26 clang-cc       0x08054181
Stack dump:
0.      Program arguments:
/home/regehr/z/tmp/llvm-gcc-r85862-install/bin/../libexec/clang-cc -triple
i386-pc-linux-gnu -S -disable-free -main-file-name small.c --relocation-model
static --disable-fp-elim --unwind-tables=0 --mcpu=pentium4 --fmath-errno=1 -O2
-fexceptions=0 -fdiagnostics-show-option -o /tmp/cc-nLLCN2.s -x c small.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@func_15'
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)
regehr at john-home:~/volatile/tmp222$ cat small.c
unsigned char g_141;
unsigned char g_153;
unsigned char func_2 (short p_3, int8p_4, unsigned char p_5, int8p_6);
unsigned char *func_15 (long long p_16)
{
  unsigned char *l_154 = &g_153;
  if (func_2
      (func_2 (1, 0x42L, g_141, 0)
       && func_26 (*l_154, 0), -1L, p_16, p_16 > (*l_154 <= 0)))
    {
    }
}


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