[cfe-dev] initialize a large static array = clang oom?

Nico Weber thakis at chromium.org
Mon Mar 3 22:08:52 PST 2014


That sounds like a bug. Can you file this at llvm.org/bugs please?


On Wed, Feb 26, 2014 at 11:48 AM, Yucong Sun <sunyucong at gmail.com> wrote:

> Please download it at
> (http://192.169.99.10/apply_cache.tar.gz)
>
> 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.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140303/8a09ed79/attachment.html>


More information about the cfe-dev mailing list