Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2017 15:30:42 +0200
From:      Willem Jan Withagen <wjw@digiware.nl>
To:        Edward Napierala <trasz@freebsd.org>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Disabling program core dumps
Message-ID:  <a2cfd37c-c2d5-e255-f877-d10674084768@digiware.nl>
In-Reply-To: <CAFLM3-pjR_wDVnjuUhZmtnaWvAX4SGvVbYhYAp-02148oUtv8A@mail.gmail.com>
References:  <32ac85ed-f0e5-2f80-299a-3bb1166cd5e6@digiware.nl> <CAFLM3-pjR_wDVnjuUhZmtnaWvAX4SGvVbYhYAp-02148oUtv8A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 27-4-2017 14:48, Edward Napierala wrote:
> There's the kern.coredump sysctl, which makes it possible to disable
> coredumping globally.

Yup, that one I knew.
But that is global, where as I'd like to run:

	setcoreoff();
	EXPECT_DEATH(test)
	setcoreon()

And for that I need some micro controls from with in the program.
Hence my fiddling with (get|set)_rlimits.

--WjW

> 
> 2017-04-27 13:36 GMT+01:00 Willem Jan Withagen <wjw@digiware.nl
> <mailto:wjw@digiware.nl>>:
> 
>     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)
> 
>     --WjW
>     _______________________________________________
>     freebsd-hackers@freebsd.org <mailto:freebsd-hackers@freebsd.org>
>     mailing list
>     https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>     <https://lists.freebsd.org/mailman/listinfo/freebsd-hackers>;
>     To unsubscribe, send any mail to
>     "freebsd-hackers-unsubscribe@freebsd.org
>     <mailto:freebsd-hackers-unsubscribe@freebsd.org>"
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a2cfd37c-c2d5-e255-f877-d10674084768>