[llvm-bugs] [Bug 52075] New: compiler crash when using large array with sanitizers

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 5 04:15:43 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52075

            Bug ID: 52075
           Summary: compiler crash when using large array with sanitizers
           Product: new-bugs
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: k.even-mendoza at imperial.ac.uk
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

This code example with -O0 -fsanitize=address:

void c() {
  char e[][(65002)][65002] = {{}, {}, {}, {}, {(6)}, {{}, (6)}};
}
int main() {
  return 0;
}
crashed the compiler (llvm 13 built with msan), with this generic error:

input/setA/3abd6bfec6d4e7b15a96782462b8a08d50355bbf.c
clang-13: error: unable to execute command: Killed
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
2153cad11ba252698c21d48723265ca7f4850a29)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/user42/data/builds_msan_13/llvm-130-build_NO_D_A_memsan/bin
clang-13: note: diagnostic msg:
********************PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg:
/tmp/3abd6bfec6d4e7b15a96782462b8a08d50355bbf-e1e531.c
clang-13: note: diagnostic msg:
/tmp/3abd6bfec6d4e7b15a96782462b8a08d50355bbf-e1e531.sh
clang-13: note: diagnostic msg:********************

It happens with llvm 11,12 and 13. 

I would expect an out-of-memory error or a warning regarding the size of the
array during compilation, but the compiler returns a generic error of the
crash. The original program was large, so it was not clear what is the problem
before reducing the program to the small code example here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211005/bab6e360/attachment.html>


More information about the llvm-bugs mailing list