<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’m going to disable (for the MacOS Builds) the memory limit checks for the time being.<div class=""><br class=""></div><div class="">Should I register a bug about this or is there someone with ‘more authority’ who would be more appropriate?</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>David</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 28, 2017, at 8:29 AM, Brian Cain <<a href="mailto:brian.cain@gmail.com" class="">brian.cain@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hmm, yes, I didn't notice that in the backtrace but you're right.<div class=""><br class=""></div><div class="">I don't think "assume infinite resources" is the bug though. malloc()'s not signal-safe on linux, so it probably isn't on MacOS either. We shouldn't be calling malloc() from the signal handler.</div><div class=""><br class=""></div><div class="">As a practical matter, maybe this is a feature that you could disable either at build-time or runtime?</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jun 28, 2017 at 10:25 AM, David Barto <span dir="ltr" class=""><<a href="mailto:barto@cambridgesemantics.com" target="_blank" class="">barto@cambridgesemantics.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Looks like the bug is that the crash handler is attempting to allocate memory, and the reason it was crashing was that it ran out of memory.<div class=""><br class=""></div><div class="">Sounds like a real clang issue to deal with as the compiler should not assume infinite resources.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class=""><span class="m_-7973541320077869025Apple-tab-span" style="white-space:pre-wrap"> </span>David</div></font></span><div class=""><div class=""><div class="h5"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 28, 2017, at 8:18 AM, Brian Cain <<a href="mailto:brian.cain@gmail.com" target="_blank" class="">brian.cain@gmail.com</a>> wrote:</div><br class="m_-7973541320077869025Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 28, 2017 at 10:10 AM, David Barto <span dir="ltr" class=""><<a href="mailto:barto@cambridgesemantics.com" target="_blank" class="">barto@cambridgesemantics.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">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.<div class=""><br class=""></div><div class="">Why did it lock up, why not throw the exception and exit?</div><span class="m_-7973541320077869025HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class=""><span class="m_-7973541320077869025m_-7213370958083013744Apple-tab-span" style="white-space:pre-wrap"></span></div></font></span><div class=""><div class=""><div class=""><div class="m_-7973541320077869025h5"><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div></div></div></div></div></blockquote></div></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">RLIMIT_AS and RLIMIT_RSS are distinct on linux, I guess I am a little surprised to see that they're not on MacOS.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">-Brian</div></div>
</div></div>
</div></blockquote></div><br class=""></div></div><span class=""><div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">David Barto<br class=""><a href="mailto:barto@cambridgesemantics.com" target="_blank" class="">barto@cambridgesemantics.com</a></div><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><br class=""></div><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">Sometimes, my best code does nothing. Most of the rest of it has bugs.<br class=""><br class=""><br class=""></div></div>
</div>
<br class=""></span></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature">-Brian</div>
</div>
</div></blockquote></div><br class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">David Barto<br class=""><a href="mailto:barto@cambridgesemantics.com" class="">barto@cambridgesemantics.com</a></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Sometimes, my best code does nothing. Most of the rest of it has bugs.<br class=""><br class=""><br class=""></div></div>
</div>
<br class=""></div></body></html>