From 4885bcb93c4efe6a7ab29b361788539d5517f1d4 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 21 Nov 2019 17:59:17 -0500 Subject: [PATCH] Tests: Report core dumps on tests. --- test_regress/driver.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 196e1730c..c2aadd541 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -1461,7 +1461,13 @@ sub _run { autoflush STDOUT 1; autoflush STDERR 1; system "$command"; - exit($? ? 10 : 0); # $?<<8 misses coredumps + my $status = $?; + if (($status & 127) == 4 # SIGILL + || ($status & 127) == 8 # SIGFPA + || ($status & 127) == 11) { # SIGSEGV + $Self->error("Exec failed with core dump"); + } + exit($? ? 10 : 0); # $?>>8 misses coredumps } waitpid($pid,0); $status = $? || 0; @@ -1472,7 +1478,7 @@ sub _run { if (!$param{fails} && $status) { my $firstline = ""; if (my $fh = IO::File->new("<$param{logfile}")) { - $firstline = $fh->getline; + $firstline = $fh->getline || ''; chomp $firstline; } $self->error("Exec of $param{cmd}[0] failed: $firstline\n");