[LLVMbugs] [Bug 18978] New: initialize a large static array = clang oom?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 26 11:45:37 PST 2014


            Bug ID: 18978
           Summary: initialize a large static array = clang oom?
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sunyucong at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12154
  --> http://llvm.org/bugs/attachment.cgi?id=12154&action=edit

clang 3.3 is fine (although slow)
clang 3.4 will oom

[2632819.135797] Out of memory: Kill process 11919 (clang) score 848
or sacrifice child
[2632819.136017] Killed process 11919 (clang) total-vm:7024768kB,
anon-rss:6925660kB, file-rss:64kB

it boils down to a single line change:

static cache_entry_t cache[APPLY_CACHE_SIZE] = {{ 0 }};

will cause the oom (in 3.3 it will produce a pretty big object file, like 128M)

static cache_entry_t cache[APPLY_CACHE_SIZE];

will fix the oom,  the end effect is same, since static variables are
initialized to 0 anyway.

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/20140226/29fcf9e6/attachment.html>

More information about the llvm-bugs mailing list