[LLVMbugs] [Bug 11056] New: very large array initialization(s) gives a segmentation fault

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 4 10:46:03 PDT 2011


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

           Summary: very large array initialization(s) gives a
                    segmentation fault
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dotsojourner at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=7398)
 --> (http://llvm.org/bugs/attachment.cgi?id=7398)
bzip2 compressed attachment. Trimmed version is inlined in the report.

# The command issued:

clang -c t.c -Wall

# output:

0  clang 0x09728db8
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple i386-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name t.c
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-target-cpu pentium4 -target-linker-version 2.18.0.20080103
-momit-leaf-frame-pointer -resource-dir /usr/bin/../lib/clang/2.9 -Wall
-ferror-limit 19 -fmessage-length 80 -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o t.o -x c t.c 
1.    t.c:29767:2: current parser token ';'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)



# clang --version

clang version 2.9 (tags/RELEASE_29/final)
Target: i386-pc-linux-gnu
Thread model: posix

the test case (trimmed to fit. see the attachment is a complete test case):
    1 int X[29942][2]={
    2 {0},
    3 {0},
    4 {0},
    5 {0},
    6 {0},
    7 {0},
..
..
..

29764 {0},
29765 {0},
29766 {0}
29767 };



# Note:

I was not able to simulate the segmentation fault with any less number of
initializing values or dimensions. The original array was [65536][16] ... on
running that, the output is:


# output 2:

0  clang 0x09728db8
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple i386-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
dst_common.i -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -target-cpu pentium4 -target-linker-version
2.18.0.20080103 -momit-leaf-frame-pointer -resource-dir
/usr/bin/../lib/clang/2.9 -Wall -ferror-limit 19 -fmessage-length 80
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o dst_common.o -x
cpp-output dst_common.i 
1.    terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

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