<div class="gmail_quote">On Wed, May 23, 2012 at 8:53 AM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Kostya Serebryany wrote:<br>
> Author: kcc<br>
> Date: Tue May 22 06:54:44 2012<br>
> New Revision: 157249<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=157249&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=157249&view=rev</a><br>
> Log:<br>
> [asan] increase the stack size limit to 256M (yes, that happens); also CHECK that the stack size is less than that on a non-main thread<br>
><br>
> Modified:<br>
>      compiler-rt/trunk/lib/asan/asan_linux.cc<br>
>      compiler-rt/trunk/lib/asan/asan_thread.h<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/asan_linux.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_linux.cc?rev=157249&r1=157248&r2=157249&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_linux.cc?rev=157249&r1=157248&r2=157249&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/asan_linux.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/asan_linux.cc Tue May 22 06:54:44 2012<br>
> @@ -39,6 +39,8 @@<br>
><br>
>   namespace __asan {<br>
><br>
> +const size_t kMaxThreadStackSize = 256 * (1<<  20);  // 256M<br>
> +<br>
>   void *AsanDoesNotSupportStaticLinkage() {<br>
>     // This will fail to link with -static.<br>
</div>>     return&_DYNAMIC;  // defined in link.h<br>
<div class="im">> @@ -294,6 +296,9 @@<br>
>       size_t stacksize = rl.rlim_cur;<br>
>       if (stacksize>  end - prev_end)<br>
>         stacksize = end - prev_end;<br>
> +    // When running with unlimited stack size, we still want to set some limit.<br>
> +    // The unlimited stack size is caused by 'ulimit -s unlimited'.<br>
> +    // Also, for some reason, GNU make spawns subrocesses with unlimited stack.<br>
<br>
</div>Typo in 'subreocesses'.<br><font color="#888888"><br></font></blockquote><div><br></div><div>Thanks. Done.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="#888888"></font><div class="HOEnZb"><div class="h5">
>       if (stacksize>  kMaxThreadStackSize)<br>
>         stacksize = kMaxThreadStackSize;<br>
>       stack_top_ = end;<br>
> @@ -310,12 +315,7 @@<br>
><br>
>     stack_top_ = (uintptr_t)stackaddr + stacksize;<br>
>     stack_bottom_ = (uintptr_t)stackaddr;<br>
> -  // When running with unlimited stack size, we still want to set some limit.<br>
> -  // The unlimited stack size is caused by 'ulimit -s unlimited'.<br>
> -  // Also, for some reason, GNU make spawns subrocesses with unlimited stack.<br>
> -  if (stacksize>  kMaxThreadStackSize) {<br>
> -    stack_bottom_ = stack_top_ - kMaxThreadStackSize;<br>
> -  }<br>
> +  CHECK(stacksize<  kMaxThreadStackSize);  // Sanity check.<br>
>     CHECK(AddrIsInStack((uintptr_t)&attr));<br>
>   }<br>
><br>
><br>
> Modified: compiler-rt/trunk/lib/asan/asan_thread.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.h?rev=157249&r1=157248&r2=157249&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.h?rev=157249&r1=157248&r2=157249&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/asan_thread.h (original)<br>
> +++ compiler-rt/trunk/lib/asan/asan_thread.h Tue May 22 06:54:44 2012<br>
> @@ -21,8 +21,6 @@<br>
><br>
>   namespace __asan {<br>
><br>
> -const size_t kMaxThreadStackSize = 16 * (1<<  20);  // 16M<br>
> -<br>
>   class AsanThread;<br>
><br>
>   // These objects are created for every thread and are never deleted,<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br>