Disabling program core dumps

Edward Napierala trasz at freebsd.org
Thu Apr 27 12:48:47 UTC 2017


There's the kern.coredump sysctl, which makes it possible to disable
coredumping globally.

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


More information about the freebsd-hackers mailing list