<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="">Sorry for the late reply on this. 10.10 and later hit a threading bug on OS X that causes a number of tests *usually equal to the number of hardware threads on your system) to fail. The workaround for this is to modify the taskgated launch daemon so that it only uses one thread. You can do so by editing the launchd plist at /System/Library/LaunchDaemons/com.apple.taskgated.plist to resemble this:<div class=""><br class=""></div><div class=""><div class=""><?xml version="1.0" encoding="UTF-8"?></div><div class=""><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<a href="http://www.apple.com/DTDs/PropertyList-1.0.dtd" class="">http://www.apple.com/DTDs/PropertyList-1.0.dtd</a>"></div><div class=""><plist version="1.0"></div><div class=""><dict></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><key>POSIXSpawnType</key></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><string>Interactive</string></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><key>EnableTransactions</key></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><true/></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><key>Label</key></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><string>com.apple.taskgated</string></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><key>MachServices</key></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><dict></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><key>com.apple.taskgated</key></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><dict></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><key>TaskSpecialPort</key></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><integer>9</integer></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span></dict></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span></dict></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><key>ProgramArguments</key></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><array></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><string>/usr/libexec/taskgated</string></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><string>-s</string></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><string>-m</string></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><string>1</string></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span></array></div><div class=""></dict></div><div class=""></plist></div><div class=""><br class=""></div><div class="">After editing the file, you’ll need to run:</div><div class=""><br class=""></div><div class="">sudo launchctl unload /System/Library/LaunchDaemons/com.apple.taskgated.plist && sudo launchctl load /System/Library/LaunchDaemons/com.apple.taskgated.plist</div><div class=""><br class=""></div><div class="">That should restart the daemon and all will work.</div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 4, 2015, at 2:33 PM, Filipe Cabecinhas via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">If you have:<div class="">llvm, clang, libcxx libcxxabi, compiler-rt, lld</div><div class="">Then you get around 31K tests. IIRC, those problems were arising before Chris Bieneman fixed compiler-rt tests to not test iOS arches on a Mac.</div><div class=""><br class=""></div><div class="">Right now, even enabling compiler-rt for iOS will still generate ~31K tests. But it's very close to the limit.</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">Regards,<br clear="all" class=""><div class=""><div class="gmail_signature"> Filipe<br class=""></div></div>
<br class=""><div class="gmail_quote">On Fri, Sep 4, 2015 at 12:49 PM, Sean Silva <span dir="ltr" class=""><<a href="mailto:chisophugis@gmail.com" target="_blank" class="">chisophugis@gmail.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 dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On Fri, Sep 4, 2015 at 12:46 PM, Sean Silva <span dir="ltr" class=""><<a href="mailto:chisophugis@gmail.com" target="_blank" class="">chisophugis@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On Fri, Sep 4, 2015 at 10:27 AM, Nico Weber via cfe-dev <span dir="ltr" class=""><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>></span> wrote:<br class=""></span><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">building 'check-all' on any of my machines running OS X 10.10 usually fails because a few tests fail due to some processes being killed by the kernel (there's always "Killed: 9" somewhere in lit's error output). Everything's fine on 10.9.</div><div class=""><br class=""></div><div class="">How do folks deal with this? Don't use 10.10 for building llvm? Is there some tweakable to tell the kernel "please don't kill my processes"?</div><div class=""><br class=""></div><div class="">Here's an example from just now:</div><div class=""><br class=""></div><div class="">FAIL: LLVM :: MC/X86/shuffle-comments.s (18589 of 28139)</div></div></blockquote><div class=""><br class=""></div></span><div class="">Btw, for the sake of having this in writing somewhere: one other thing I've run into (I was generating a huge number of lit tests for an artificial reason; wasn't during normal development) is that once you go past ~32K tests (2^15) lit's current way it queues up processes will cause it to completely hang on Mac. Essentially the problem is that it has a for loop like:</div><div class=""><br class=""></div><div class="">for t in tests:</div><div class=""> push_onto_threadsafe_queue(t)</div><div class="">... kick off worker threads that consume from the queue ...</div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Maybe clearer:</div><span class=""><div class=""><br class=""></div><div class=""><div class="">for t in tests:</div><div class=""> push_onto_threadsafe_queue(t)</div></div><div class="">...</div><div class="">kick off worker threads that consume from the queue<br class=""></div><div class="">...</div><div class=""><br class=""></div></span><div class="">i.e. It pushes all tests onto the queue before it starts kicking off jobs.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">-- Sean Silva</div></font></span><span class=""><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">unfortunately, push_onto_threadsafe_queue ups an OS semaphore and on mac there is an upper limit of ~32K. Once you hit that the push_onto_threadsafe_queue operation will block and therefore lit will be completely blocked.</div><div class=""><br class=""></div><div class="">Someday we will need to e.g. spawn off a feeder thread to do the push_onto_threadsafe_queue loop.</div><div class=""><br class=""></div><div class="">Filipe, did you say that you had actually run into the 32K limit at some point during regular development? (what combination of LLVM repos were checked out and being tested simultaneously?)</div><span class=""><font color="#888888" class=""><div class=""><br class=""></div><div class="">-- Sean Silva</div><div class=""> </div></font></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><div dir="ltr" class=""><div class="">******************** TEST 'LLVM :: MC/X86/shuffle-comments.s' FAILED ********************</div><div class="">Script:</div><div class="">--</div><div class="">/Users/thakis/src/chromefetch/src/third_party/llvm-bootstrap/./bin/llvm-mc /Volumes/MacintoshHD2/src/chromefetch/src/third_party/llvm/test/MC/X86/shuffle-comments.s -triple=x86_64-unknown-unknown | /Users/thakis/src/chromefetch/src/third_party/llvm-bootstrap/./bin/FileCheck /Volumes/MacintoshHD2/src/chromefetch/src/third_party/llvm/test/MC/X86/shuffle-comments.s</div><div class="">--</div><div class="">Exit Code: 137</div><div class=""><br class=""></div><div class="">Command Output (stderr):</div><div class="">--</div><div class="">/Volumes/MacintoshHD2/src/chromefetch/src/third_party/llvm-bootstrap/test/MC/X86/Output/shuffle-comments.s.script: line 1: 47457 Killed: 9 /Users/thakis/src/chromefetch/src/third_party/llvm-bootstrap/./bin/llvm-mc /Volumes/MacintoshHD2/src/chromefetch/src/third_party/llvm/test/MC/X86/shuffle-comments.s -triple=x86_64-unknown-unknown</div><div class=""> 47459 | /Users/thakis/src/chromefetch/src/third_party/llvm-bootstrap/./bin/FileCheck /Volumes/MacintoshHD2/src/chromefetch/src/third_party/llvm/test/MC/X86/shuffle-comments.s</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Nico</div></div>
<br class=""></span><span class="">_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="">
<br class=""></span></blockquote></div><br class=""></div></div>
</blockquote></span></div><br class=""></div></div>
</blockquote></div><br class=""></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></div></body></html>