[LLVMbugs] [Bug 8506] New: clang crash

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 29 08:28:18 PDT 2010


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

           Summary: clang crash
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu, chenyang at cs.utah.edu


Valgrind says it's use of freed memory.

[regehr at n6 tmp700]$ clang -w -c -O small.c
0  clang 0x093d1588
Stack dump:
0.    Program arguments:
/mnt/local/randomtest/compiler-install/llvm-gcc-r117638-install/bin/clang -cc1
-triple i386-pc-linux-gnu -S -disable-free -main-file-name small.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu
pentium4 -target-linker-version 2.20.1 -resource-dir
/mnt/local/randomtest/compiler-install/llvm-gcc-r117638-install/bin/../lib/clang/2.9
-O2 -w -ferror-limit 19 -fmessage-length 104 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-NjWHW2.s -x c small.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.    Running pass 'Value Propagation' on function '@func'
clang: error: clang frontend command failed due to signal 11 (use -v to see
invocation)

[regehr at n6 tmp700]$ cat small.c

typedef signed char int8_t;
typedef unsigned char uint8_t;
struct S0
{
  uint8_t f1;
  uint8_t f2;
  uint8_t f4;
};
struct S1
{
  unsigned f0:14;
  signed f1:14;
  signed f3:22;
};
uint8_t g_2;
uint8_t g_8;
struct S1 g_39 = {
  0
};

struct S1 g_42 = {
  0
};

uint8_t *const
func (int8_t p_63, struct S0 p_64, struct S1 *const *p_65)
{
  uint8_t l_67[2][8][1][3];
  uint8_t l_68[6];
lbl_83:l_68[0] |= g_42.f1 == ~l_67[0][6][0][1];
lbl_331:for (p_63 = 1; p_63; p_63 = 2, -0)
    {
    lbl_299:l_68[0] =
    p_64.f4 >= p_64.f1, g_42.f3, p_64.f2, 0 ? : +g_39.f0, p_64.f1,
    -p_64.f2;
    }
  {
    if (g_2)
      goto lbl_83;
    for (0; g_8; g_8 = g_8 + 1)
      {
      }
    if (p_63)
      goto lbl_299;
  }
  return 0;
}

[regehr at n6 tmp700]$ clang -v

clang version 2.9 (trunk 117638)
Target: i386-pc-linux-gnu
Thread model: posix

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