[cfe-dev] Clang 'locks up' when compiling optimized

Brian Cain via cfe-dev cfe-dev at lists.llvm.org
Wed Jun 28 08:18:50 PDT 2017


On Wed, Jun 28, 2017 at 10:10 AM, David Barto <barto at cambridgesemantics.com>
wrote:

> This is part of an in-memory system (no swap space configured) so RSS
> would match the AS size for this use case. From what I read about RSS and
> AS for MacOS and Linux.
>
> Why did it lock up, why not throw the exception and exit?
>
>
>
Dunno, it seems like the OS is driving now and it's not immediately clear
to me why that system call wouldn't yield either success or failure.  But
clang is asking for a resource (more memory), and I've seen those stall
before.  My experience with linux (may or may not be applicable) leads me
to believe that the system is perhaps resource-constrained and your task is
pending while it tries to free up those resources.

RLIMIT_AS and RLIMIT_RSS are distinct on linux, I guess I am a little
surprised to see that they're not on MacOS.

In any case, the most likely culprit is your setrlimit.  If I were you I
would take clang out of the loop entirely and write a test program that
does allocations just like the ones clang does (various sized mallocs, you
could try profiling to get a ballpark histogram).  I would be surprised if
you don't see the same behavior.

-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170628/8568b556/attachment.html>


More information about the cfe-dev mailing list