[LLVMbugs] [Bug 7844] New: clang crash due to memory unsafety

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Aug 8 18:20:30 PDT 2010


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

           Summary: clang crash due to memory unsafety
           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


[regehr at gamow tmp422]$ clang -v
clang version 2.8 (trunk 110556)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ cat small.c
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef long int int64_t;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;
static int8_t (safe_unary_minus_) (int8_t si)
{
  return -si;
}

static int8_t (safe_add_func_int8_t_s_s) (int8_t si1, int8_t si2)
{
  return (si1 + si2);
}

static int32_t (safe_mod_) (int32_t si1, int32_t si2)
{
  return ((si2) || ((si1 == (1)) && (si2 == (0)))) ? ((si1)) : (si1 + si2);
}

static int64_t (safe_add_func_int64_t_s_s) (int64_t si1, int64_t si2)
{
  return (((si1 > 0) && (si2 > 0) && (si1 > ((0) - si2)))
          || ((si1 < 0) && (si2 < 0)
              && (si1 < ((1) - si2)))) ? ((si1)) : (si1 + si2);
}

struct S0
{
  int32_t f0;
  const unsigned f1:9;
  signed:0;
  unsigned f2:6;
  const unsigned f3:8;
  const uint32_t f4;
  unsigned f5:29;
  signed f6:28;
};
int32_t g_3;
struct S0 g_23 = { -1L, 424, 30, 243, 4L, 361344876, -3543 };

int32_t *g_34 = &g_3;
int32_t g_68[2][10] =
  { 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L };
int32_t *g_108 = &g_68[1][8];
const struct S0 *g_143;
int32_t **g_163 = &g_34;
int32_t g_180;
struct S0 *g_223;
int32_t *const g_285[3][1][8][4] =
  { {}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0,}, };
int32_t
func_65 (uint16_t p_66)
{
  uint8_t l_67[5][8][1];
  struct S0 *l_73 = &g_23;
  int32_t *l_81[3][3][6][1];
  uint32_t l_199;
  int32_t ***l_200 = &g_163;
  int32_t *l_222[4];
  struct S0 l_224 =
    { 0xAC423974L, 369, 12, 61, 0xEA04E116L, 411432885, -12369 };
  int8_t l_254;
  const struct S0 *l_271 = &g_23;
  const int32_t *l_277;
  uint32_t l_341;
  int i, j, k, l;
  l_67[i][j][k];
  l_81[i][j][k][l] = &g_3;
  l_222[i];
lbl_343:l_67[g_3][p_66][g_68[0][7]];
  const int8_t l_115;
  int32_t l_128;
  int32_t *l_192 = &g_3;
lbl_258:if (0)
    {
      int32_t **l_225 = &l_222[3];
      struct S0 *l_230[7][4][1][1];
      struct S0 l_234 =
        { 0x00A86ED1L, 353, 39, 221, 0x735A8DBCL, 204544828, -61 };
      int i, j, k, l;
      l_230[i][j][k][l] = &l_224;
      (0);
      if (((0) & (0)))
        {
          uint64_t l_233;
          if (((0) || (0)))
            {
              int64_t l_240;
              int32_t l_241;
              l_241 &= (g_23.f0 < (1));
              (0);
            }
          else
            (*g_34) |= 0;
          goto lbl_244;
        }
      else
        {
          int32_t *const l_242 = &g_68[0][7];
          int32_t *l_243 = &g_68[0][7];
        lbl_244:0;
          if (l_67[0][4][0]);
          else
            {
              int32_t *l_246[9][10];
              struct S0 **l_253 = &l_230[6][0][0][0];
              int i, j;
              (0);
              int32_t *l_255 = &g_3;
              l_254 ^= (0);
              (0);
    }}}
  else
    {
      int32_t l_272[7];
      int32_t *l_276;
      const struct S0 *l_284 = &l_224;
      uint16_t l_319;
      uint16_t l_338;
      int i;
      l_272[i];
    lbl_330:if (0)
        goto lbl_258;
      for (0; (p_66); 1)
        {
          const struct S0 *l_261 = &g_23;
          int32_t l_262;
          struct S0 **l_264[6];
          struct S0 ***l_263 = &l_264[3];
          int32_t l_293;
          const struct S0 *l_297[4][4];
          const int32_t *l_315[7][3][1];
          int i, j, k;
          l_264[i] = &g_223;
          l_297[i][j] = &g_23;
          if (func_103 (l_261, g_68[0][2]))
            {
              uint8_t l_270[10];
              int32_t *l_275 = &l_272[4];
              int32_t **l_278;
              int32_t **l_279 = &l_222[3];
              struct S0 *l_286 = &g_23;
              const int32_t *l_296 = &l_293;
              int64_t l_303;
              int16_t l_322[5];
              int i;
              l_270[i];
              l_322[i];
              (0);
              struct S0 l_287 =
                { 0x6428253FL, 150, 63, 113, 0x15A3E27EL, 165008711, 11238 };
              int32_t l_290;
              (**g_163) |= g_23.f6;
              l_290 &= (1);
            lbl_298:(0);
              (*l_275) &= ((0));
              goto lbl_298;
              (0);
              int32_t l_307;
              const int32_t *l_316 = &l_262;
              int16_t l_327;
              break;
              break;
              continue;
              const int32_t *l_306 = &g_3;
              int32_t *l_314;
              (0);
              (0);
              (*l_275) = ((0) | (&g_285[0][0][4][3] == &l_306));
              return 0;
            }
          else
            {
              const int32_t *l_333 = &g_3;
              int8_t l_334;
              int32_t l_337;
              for (0; (l_293); l_293 = safe_add_func_int8_t_s_s (l_293, 0))
                {
                  if (p_66)
                    goto lbl_330;
                  if (0)
                    goto lbl_339;
                  l_337 &=
                    ((((0)),
                      (((func_103 (&g_23, 0)))
                       || (func_103 (l_261, 0)
                           && (safe_add_func_int64_t_s_s (p_66, (0)))))));
                }
            lbl_339:(*g_34) ^= 0;
              (*g_34) &= 0;
              0;
            }
        }
      if ((0))
        {
          uint32_t l_340;
          int32_t l_342;
          l_342 &= (((((((0)) && ((0) <= (0)))))));
          goto lbl_343;
        }
      else
        {
          uint32_t l_344;
          return 0;
        }
    }
  return 0;
}

int32_t
func_103 (const struct S0 * p_104, uint32_t p_105)
{
  return (*g_34);
}
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ 
[regehr at gamow tmp422]$ valgrind -q --trace-children=yes clang -O1 small.c -w -c
==30239== Invalid read of size 1
==30239==    at 0x145023F: llvm::AliasSetTracker::add(llvm::CallSite) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1450F4C: llvm::AliasSetTracker::add(llvm::AliasSetTracker
const&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B50E: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B5AB6: clang::EmitBackendOutput(clang::Diagnostic&,
clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B1BFA: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x8CB5CE: clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==  Address 0x5fb28f0 is 80 bytes inside a block of size 168 free'd
==30239==    at 0x4C24A7A: operator delete(void*) (vg_replace_malloc.c:346)
==30239==    by 0x13597FE: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359F3C: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359DD4: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359DD4: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B85B: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239== 
==30239== Invalid read of size 1
==30239==    at 0x1450290: llvm::AliasSetTracker::add(llvm::CallSite) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1450F4C: llvm::AliasSetTracker::add(llvm::AliasSetTracker
const&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B50E: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B5AB6: clang::EmitBackendOutput(clang::Diagnostic&,
clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B1BFA: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x8CB5CE: clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==  Address 0x5fb28f0 is 80 bytes inside a block of size 168 free'd
==30239==    at 0x4C24A7A: operator delete(void*) (vg_replace_malloc.c:346)
==30239==    by 0x13597FE: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359F3C: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359DD4: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359DD4: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B85B: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239== 
==30239== Invalid read of size 8
==30239==    at 0x1450298: llvm::AliasSetTracker::add(llvm::CallSite) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1450F4C: llvm::AliasSetTracker::add(llvm::AliasSetTracker
const&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B50E: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B5AB6: clang::EmitBackendOutput(clang::Diagnostic&,
clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B1BFA: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x8CB5CE: clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==  Address 0x5fb28d0 is 48 bytes inside a block of size 168 free'd
==30239==    at 0x4C24A7A: operator delete(void*) (vg_replace_malloc.c:346)
==30239==    by 0x13597FE: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359F3C: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359DD4: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1359DD4: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B85B: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239== 
==30239== Invalid read of size 1
==30239==    at 0x14502A2: llvm::AliasSetTracker::add(llvm::CallSite) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1450F4C: llvm::AliasSetTracker::add(llvm::AliasSetTracker
const&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B50E: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B5AB6: clang::EmitBackendOutput(clang::Diagnostic&,
clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B1BFA: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x8CB5CE: clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==30239== 
0  clang           0x0000000001611f2f
1  clang           0x0000000001613fc2
2  libpthread.so.0 0x0000000004e39190
3  clang           0x00000000014502a2
llvm::AliasSetTracker::add(llvm::CallSite) + 130
4  clang           0x0000000001450f4d
llvm::AliasSetTracker::add(llvm::AliasSetTracker const&) + 141
5  clang           0x000000000135b50f
6  clang           0x0000000001479054
llvm::LPPassManager::runOnFunction(llvm::Function&) + 1060
7  clang           0x00000000015655fd
llvm::FPPassManager::runOnFunction(llvm::Function&) + 557
8  clang           0x0000000001449a0b
9  clang           0x000000000144a175
10 clang           0x0000000001565194
llvm::MPPassManager::runOnModule(llvm::Module&) + 500
11 clang           0x0000000001565307 llvm::PassManagerImpl::run(llvm::Module&)
+ 167
12 clang           0x00000000007b5ab7
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 1639
13 clang           0x00000000007b1bfb
14 clang           0x00000000008cb5cf clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 335
15 clang           0x00000000007b2b74 clang::CodeGenAction::ExecuteAction() +
68
16 clang           0x00000000006cdbf5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 357
17 clang           0x00000000006a9a1b cc1_main(char const**, char const**, char
const*, void*) + 2651
18 clang           0x00000000006b03fd main + 4077
19 libc.so.6       0x0000000005a13abd __libc_start_main + 253
20 clang           0x00000000006a70b9
Stack dump:
0.      Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name small.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/lib/clang/2.8
-O1 -w -ferror-limit 19 -fmessage-length 99 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-bAyHMs.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 'Loop Pass Manager' on function '@func_65'
5.      Running pass 'Loop Invariant Code Motion' on basic block '%for.cond'
==30239== 
==30239== Process terminating with default action of signal 11 (SIGSEGV)
==30239==  Access not within mapped region at address 0x8
==30239==    at 0x14502A2: llvm::AliasSetTracker::add(llvm::CallSite) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1450F4C: llvm::AliasSetTracker::add(llvm::AliasSetTracker
const&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x135B50E: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1479053: llvm::LPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x15655FC: llvm::FPPassManager::runOnFunction(llvm::Function&)
(in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1449A0A: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x144A174: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565193: llvm::MPPassManager::runOnModule(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x1565306: llvm::PassManagerImpl::run(llvm::Module&) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B5AB6: clang::EmitBackendOutput(clang::Diagnostic&,
clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x7B1BFA: ??? (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==    by 0x8CB5CE: clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) (in
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r110556-install/bin/clang)
==30239==  If you believe this happened as a result of a stack
==30239==  overflow in your program's main thread (unlikely but
==30239==  possible), you can try to increase the size of the
==30239==  main thread stack using the --main-stacksize= flag.
==30239==  The main thread stack size used in this run was 8388608.
clang: error: clang frontend command failed due to signal 11 (use -v to see
invocation)
[regehr at gamow tmp422]$

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