Can I avoid logging a message in /var/log/messages when testing core dumps?

James E Keenan jkeenan at
Thu Jun 10 00:50:18 UTC 2021

I am writing to try to understand a difference in logging behavior 
between FreeBSD on the one hand and other OSes such as Linux and OpenBSD 
on the other.

Context:  Smoke-testing of commits to the development branch of the Perl 
5 core distribution.

File:     t/op/dump.t 

Problem:  When this test file is run on FreeBSD, core is dumped -- which 
is intended -- and a message is logged to /var/log/messages -- which is 
not intended.  When the test file is run on either Linux or OpenBSD, 
core is dumped but no message is logged to /var/log/messages.  This 
fills up the smoke-tester's log with messages that do not, for the 
purpose of testing, need to be logged.

Reproduce:  In one terminal, 'tail -f /var/log/messages`.  In another 
terminal, run the following program.

$ cat
my $pid = fork;
die "fork: $!\n" unless defined $pid;
if ($pid) {
     # parent
     waitpid($pid, 0);
else {
     print qq(A);
     CORE::dump foo;
     print qq(B);

On FreeBSD, a record like the following is added to /var/log/messages:

Jun 10 00:35:18 perlmonger kernel: pid 58220 (perl), jid 0, uid 1002: 
exited on signal 6 (core dumped)

Since the message is spurious from the point of view of smoke-testing, 
we would like to be able to suppress it.

Is there a FreeBSD-specific rationale for this logging?

Is there any way to suppress this log message?

Thank you very much.
Jim Keenan

More information about the freebsd-questions mailing list