[sanitizer] only lower the soft coresize limit in DisableCoreDumper
Kostya Serebryany
kcc at google.com
Thu Jul 3 04:45:51 PDT 2014
On Thu, Jul 3, 2014 at 3:42 PM, Stephan Bergmann <sbergman at redhat.com>
wrote:
> On 07/03/2014 10:06 AM, Kostya Serebryany wrote:
>
>> what's the reason?
>>
>
> As stated, "so that e.g. a spawned sub-[process;
Ah. That makes more sense!
Could you please add a test?
I think the best place would
be compiler-rt/test/sanitizer_common/TestCases/Linux
> 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.
>
> Stephan
>
> On Wed, Jun 25, 2014 at 6:56 PM, Stephan Bergmann <sbergman at redhat.com
>> <mailto:sbergman at redhat.com>> wrote:
>>
>> ...so that e.g. a spawned sub-thread could increase that limit again:
>>
>> Index: lib/sanitizer_common/__sanitizer_posix_libcdep.cc
>> ==============================__============================
>> ==__=======
>> --- lib/sanitizer_common/__sanitizer_posix_libcdep.cc
>> (revision 211695)
>> +++ lib/sanitizer_common/__sanitizer_posix_libcdep.cc
>>
>> (working copy)
>> @@ -46,8 +46,10 @@
>>
>> void DisableCoreDumper() {
>> struct rlimit nocore;
>> + if (getrlimit(RLIMIT_CORE, &nocore) == -1) {
>> + nocore.rlim_max = 0;
>> + }
>> nocore.rlim_cur = 0;
>> - nocore.rlim_max = 0;
>> setrlimit(RLIMIT_CORE, &nocore);
>> }
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140703/3a4aef8f/attachment.html>
More information about the llvm-commits
mailing list