Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2017 15:39:08 +0200
From:      Willem Jan Withagen <wjw@digiware.nl>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Disabling program core dumps
Message-ID:  <2e645e8d-125c-b2c8-1401-5a9da68ce5fb@digiware.nl>
In-Reply-To: <20170427125725.GM1622@kib.kiev.ua>
References:  <32ac85ed-f0e5-2f80-299a-3bb1166cd5e6@digiware.nl> <20170427125725.GM1622@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On 27-4-2017 14:57, Konstantin Belousov wrote:
> On Thu, Apr 27, 2017 at 02:36:52PM +0200, Willem Jan Withagen wrote:
>> Hi,
>>
>> Running (googletest) tests some are expected to die: EXPECT_DEATH().
>> This normally dumps a core, but since it is expected that core is rather
>> useless.
>>
>> Thusfar I've found the best way to limit a program to dump core (from
>> within the program) is to set its RLIMIT_CORE to 0.
>>
>> So I can do this before the test, and then set the old size back once
>> the test is finished.
>>
>> Or is there another way, like setting a flag in process state (which I
>> have not been able to find)

> See procctl(2) PROC_TRACE_CTL command.  Disabling tracing also disables
> coredumping.

Ah, that I did not find. Found procctl, but browsed thru it looking for
coredump, but it is wrapped over 2 lines :)

So setting PROC_TRACE_CTL_DISABLE_EXEC would work with googletests which
fork to actually run the DEATH tests??

--WjW





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2e645e8d-125c-b2c8-1401-5a9da68ce5fb>