[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


            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:

clang-13: error: unable to execute command: Killed
clang-13: error: clang frontend command failed due to signal (use -v to see
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
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:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg:
clang-13: note: diagnostic msg:
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