<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLVM ERROR: out of memory for very large .c files"
   href="https://bugs.llvm.org/show_bug.cgi?id=52166">52166</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM ERROR: out of memory for very large .c files
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>andrei.roventa@windriver.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=25360" name="attach_25360" title="stack dump">attachment 25360</a> <a href="attachment.cgi?id=25360&action=edit" title="stack dump">[details]</a></span>
stack dump

The following failure is seen frequently (but cannot be reproduced
consistently) for some large files: "LLVM ERROR: out of memory".

The build machine has over 32GB or RAM and most of the time it shows that more
than 20GB are free when these failures occur.

These large files where such failure occur, each has a single very large array
used in testing of the form:

unsigned char pSource13[] =
{ 0x50, 0x4e, 0x6b, 0x57, 0x30, 0x71, 0x33, 0x59, 0x49, 0x31, 0x30, 0x30, ....
0x68, 0x36, 0x71, 0x55, 0x31, 0x66, 0x48, 0x54, 0x51, 0x58, 0x30, 0x3e, 0x55,
0x56, 0x53, 0x47 };

Attached are some of the trace files for this. I cannot attach the source file
as it is extremely large (more than 150MB), but a trimmed down version was
added for reference.


LLVM ERROR: out of memory
Stack dump:
0.      Program arguments:
/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/compilers/llvm-10.0.1.1/LINUX64/bin/clang
-fno-builtin --target=arm64 -ffixed-x18 -mfix-cortex-a53-835769 -std=c11
-D__vxworks -D__VXWORKS__ -D__ELF__ -D_HAVE_TOOL_XTORS -nostdlibinc -nostdinc++
-ftls-model=local-exec -fno-builtin -fno-strict-aliasing -D_USE_INIT_ARRAY
-finline-hint-functions -mllvm -inline-threshold=0 -fno-exceptions -D_NO_EX
-fno-rtti -D_NO_RTTI -mno-implicit-float -g -O2 -Wall -Wconversion
-Wno-sign-conversion -DCPU=_VX_ARMARCH8A -DTOOL_FAMILY=llvm -DTOOL=llvm
-D_WRS_KERNEL -DARMEL -DINET -U__USER_LABEL_PREFIX__ -D__USER_LABEL_PREFIX__=
-DARMEL -DINET -U__USER_LABEL_PREFIX__ -D__USER_LABEL_PREFIX__=
-D_WRS_LIB_BUILD
-D_VSB_CONFIG_FILE="/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/samples/prebuilt_projects/vsb_ARMARCH8A_GOS_SAFETY/h/config/vsbConfig.h"
-isystem/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/samples/prebuilt_projects/vsb_ARMARCH8A_GOS_SAFETY/krnl/h/public
-isystem/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/samples/prebuilt_projects/vsb_ARMARCH8A_GOS_SAFETY/krnl/h/system
-I/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/samples/prebuilt_projects/vsb_ARMARCH8A_GOS_SAFETY/share/h
-D_VSB_PUBLIC_HDR_DIR=/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/samples/prebuilt_projects/vsb_ARMARCH8A_GOS_SAFETY/krnl/h/public
-I. -MD -c -o
/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/samples/prebuilt_projects/vsb_ARMARCH8A_GOS_SAFETY/krnl/ARMARCH8A/common/objvxcert_test/zlib_25MB_unique_srting_TC19_in.o
zlib_25MB_unique_srting_TC19_in.c 
1.      zlib_25MB_unique_srting_TC19_in.c:568001:49: current parser token ','
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.1.1 (<a href="http://gitlab.devstar.cloud/compilers/llvm/clang.git">http://gitlab.devstar.cloud/compilers/llvm/clang.git</a>
5449acbaec3d4a4a4cf80bc0bbfd17270fce7bcb) (llvm/llvm.git
93ac1237629b578d24c2aedbbe345c20a2cb7767)
Target: arm64
Thread model: posix
InstalledDir:
/home/aroventa/36607/WindRiver_HVP_SC0630ear4/helix/compilers/llvm-10.0.1.1/LINUX64/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/zlib_25MB_unique_srting_TC19_in-29a3fb.c
clang: note: diagnostic msg: /tmp/zlib_25MB_unique_srting_TC19_in-29a3fb.sh
clang: note: diagnostic msg:</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>