[llvm-bugs] [Bug 51656] New: fatal error: error in backend: SmallVector unable to grow. Requested capacity (4294967296) is larger than maximum value for size type (4294967295)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 27 18:33:05 PDT 2021


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

            Bug ID: 51656
           Summary: fatal error: error in backend: SmallVector unable to
                    grow. Requested capacity (4294967296) is larger than
                    maximum value for size type (4294967295)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hi all.

The following program can not be compiled in trunk clang and it eats all my
machine's memory (~300G) then crashes.

$cat small.c
#include <stdint.h>
i_0 = 0x8ECD075E;
ui_3 = 0x08977994;
uc_4 = 0x2D;
uli_5 = 0x4411BDCE4F3D969E;
li_7 = 0x0;
li_10 = 0x095C7ABB74102A98;
uli_12 = 0x26B2F0F7AA21F311;
uli_15 = 0x0;
func_1(uint32_t ui_17) {
  uint16_t us_19 = 0xFC96;
  uint64_t ptr_20 = uli_12;
  uint32_t ui_21 = 0x54C1FC46;
  for (us_19 = 18; us_19 <= 68; us_19 += 1) {
    uint64_t **ptr_29 = ptr_20;
    int64_t li_30 = 0xCC26ECA322A5E1C7;
    int16_t s_33 = 0xB176;
    if ((0 >= 0)) {
      uint64_t ptr_35 = uli_12;
      if (0) {
        uint64_t ptr_41 = ptr_35;
        uint32_t ui_43 = 0x706BAD24;
        if (0)
          if (0) {
            for (ptr_29 = 13; **ptr_29 <= 88; **ptr_29 += 1)
              if (0)
                ;
            for (uc_4 = 26; uc_4 <= 81; uc_4 += 1) {
              if (0)
                for (i_0 = 16; ui_17 <= 63; ui_17 += 1)
                lbl237BFDEF:
                  for (ui_43 = 16; ui_43 <= 59; ui_43 += 1)
                    ;
            }
          }
      } else {
        for (li_10 = 11; li_10 <= 34; li_10 += 1) {
          int16_t s_51 = 0x0;
          if (((ui_17 = (s_51 ^= (ui_3 %= ui_17))) && 0))
            ;
        }
        for (ui_21 = 19; ui_21 <= 45; ui_21 += 1) {
          if (0)
            ;
          else
            for (li_7 = 17; uli_15 <= 54; uli_15 += 1)
              goto lbl237BFDEF;
          for (ui_17 = 5; ui_17 <= 49; ui_17 += 1)
            ;
        }
      }
    }
    for (uli_5 = 10; uli_5 <= 60; s_33 += 1)
      ;
  }
}

$time clang -c -w -O3 -g small.c
fatal error: error in backend: SmallVector unable to grow. Requested capacity
(4294967296) is larger than maximum value for size type (4294967295)
clang-14: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project
a45d72e0247d080eb9437736bb6cadfc27e4c065)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/compilers/llvm-project/build/bin
clang-14: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-14: note: diagnostic msg: /tmp/small-b8b355.c
clang-14: note: diagnostic msg: /tmp/small-b8b355.sh
clang-14: note: diagnostic msg:

********************

real    1m25.484s
user    1m4.453s
sys     0m21.027s

$time clang -c -w -O2 -g small.c

real    0m0.092s
user    0m0.035s
sys     0m0.032s

$clang -v
clang version 14.0.0 (https://github.com/llvm/llvm-project
a45d72e0247d080eb9437736bb6cadfc27e4c065)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/compilers/llvm-project/build/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64


Thanks,
Haoxin

-- 
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/20210828/6c354a5e/attachment-0001.html>


More information about the llvm-bugs mailing list