From 9f8fc983d5fe23698f8fd6f7457568cd689ed0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 16 Dec 2022 09:59:09 +0200 Subject: MDEV-30242 MTR fails to report stack traces of all threads by default An unfortunate change to the default behavior of the handling of core dumps was implemented in commit e9be5428a27eaaccf142f2bd53f4d30e8e368484 by making MTR_PRINT_CORE=small the default value, that is, to only display the stack trace of one thread in crash reports. Many if not most failures that occur in regression tests are sporadic and involve race conditions or deadlocks. To be able to analyze such failures, having the stack traces of all active threads is a must, because CI environments typically do not save any core dumps. While the environment variable MTR_PRINT_CORE could be set in CI environments to compensate for the unfortunate change, it is better to revert to the old default (dumping all threads) so that no explicit action will be required from maintainers of independent CI systems. In that case, if something fails once in a blue moon, we can have some hope of diagnosing it based on the output. We fix this regression by defaulting the unset environment variable MTR_PRINT_CORE to "medium". --- mysql-test/lib/My/CoreDump.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm index 298cf9ef877..05b6edf1385 100644 --- a/mysql-test/lib/My/CoreDump.pm +++ b/mysql-test/lib/My/CoreDump.pm @@ -108,7 +108,7 @@ for my $f (keys %print_formats) register_opt('print-core|C', ':s', "Print core dump format: ". $print_formats. " (for not printing cores). ". - "Defaults to value of MTR_PRINT_CORE or 'short'"); + "Defaults to value of MTR_PRINT_CORE or 'medium'"); if (!IS_WINDOWS) { register_opt('print-method', '=s', @@ -134,7 +134,7 @@ sub env_or_default($$) { } sub pre_setup() { - $config{print_core}= env_or_default('short', 'MTR_PRINT_CORE') + $config{print_core}= env_or_default('medium', 'MTR_PRINT_CORE') if not defined $config{print_core}; $config{print_method}= (IS_WINDOWS) ? 'cdb' : 'auto' if not defined $config{print_method}; -- cgit v1.2.1