<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 3, 2014 at 3:42 PM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<br>
<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">On 07/03/2014 10:06 AM, Kostya Serebryany wrote:<br>
<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">
what's the reason?<br>
</blockquote>
<br>
As stated, "so that e.g. a spawned sub-[process;</blockquote><div><br></div><div>Ah. That makes more sense! </div><div>Could you please add a test? </div><div>I think the best place would be compiler-rt/test/sanitizer_common/TestCases/Linux</div>
<div><br></div><div><br></div><div> </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"> sorry, typo in the original mail] could increase that limit again." I needed this when debugging a scenario where a process built with -fsanitize=address spawns an "unrelated" process (not built with -fsanitize=address) and the easiest debug vector would have been to add a call to abort() at a certain place in the sub-process's code and afterwards analyze the corefile, if one could have been written.<br>
<br>
Stephan<br>
<br>
<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 class="">
On Wed, Jun 25, 2014 at 6:56 PM, Stephan Bergmann <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a><br></div><div class="">
<mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>> wrote:<br>
<br>
...so that e.g. a spawned sub-thread could increase that limit again:<br>
<br></div>
Index: lib/sanitizer_common/__<u></u>sanitizer_posix_libcdep.cc<br>
==============================<u></u>__============================<u></u>==__=======<br>
--- lib/sanitizer_common/__<u></u>sanitizer_posix_libcdep.cc<br>
(revision 211695)<br>
+++ lib/sanitizer_common/__<u></u>sanitizer_posix_libcdep.cc<div class=""><br>
(working copy)<br>
@@ -46,8 +46,10 @@<br>
<br>
void DisableCoreDumper() {<br>
struct rlimit nocore;<br>
+ if (getrlimit(RLIMIT_CORE, &nocore) == -1) {<br>
+ nocore.rlim_max = 0;<br>
+ }<br>
nocore.rlim_cur = 0;<br>
- nocore.rlim_max = 0;<br>
setrlimit(RLIMIT_CORE, &nocore);<br>
}<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br></div></div>