[LLVMbugs] [Bug 8073] New: clang segfault with certain pointer declaration.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 3 09:59:10 PDT 2010


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

           Summary: clang segfault with certain pointer declaration.
           Product: clang
           Version: 2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nbowler at draconx.ca
                CC: llvmbugs at cs.uiuc.edu


Compiling the following program causes clang to instantly segfault:

  int main(void)
  {
     static void *x = &x;
     return 0;
  }

Spewing the following to the console:

  0  clang           0x0000000001071b3f
  1  clang           0x000000000107218c
  2  libpthread.so.0 0x00007f6c70508010
  3  clang           0x0000000000f7cfeb
  4  clang           0x0000000000f7d31f
  5  clang           0x0000000000cf8144
  6  clang           0x0000000000cf1f2f
  7  clang           0x00000000010011e8
  8  clang           0x000000000100125a
  9  clang           0x000000000041b252
  10 clang           0x00000000005e8424
  11 clang           0x000000000041e257
  12 clang           0x000000000041174a
  13 clang           0x0000000000414a33 main + 1731
  14 libc.so.6       0x00007f6c6f813bbd __libc_start_main + 253
  15 clang           0x000000000040fc79
  Stack dump:
  0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu -S
-disable-free -disable-llvm-verifier -main-file-name test.c -mrelocation-model
static -mdisable-fp-elim -mconstructor-aliases -munwind-tables -target-cpu
x86-64 -resource-dir /usr/lib/clang/1.1 -fmessage-length 80 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-Mmqfg7.s -x c test.c 
  1.    <eof> parser at end of file
  2.    Code generation
  clang: error: compiler command failed due to signal 11 (use -v to see
invocation)

Moving the declaration of x to file scope or removing the 'static'
storage-class specifier allows the program to compile successfully.

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