Skip to content

Commit 026984c

Browse files
committed
MDEV-26949 --debug-gdb installs redundant signal handlers
There is a server startup option --gdb a.k.a. --debug-gdb that requests signals to be set for more convenient debugging. Most notably, SIGINT (ctrl-c) will not be ignored, and you will be able to interrupt the execution of the server while GDB is attached to it. When we are debugging, the signal handlers that would normally display a terse stack trace are useless. When we are debugging with rr, the signal handlers may interfere with a SIGKILL that could be sent to the process by the environment, and ruin the rr replay trace, due to a Linux kernel bug https://lkml.org/lkml/2021/10/31/311 To be able to diagnose bugs in kill+restart tests, we may really need both a trace before the SIGKILL and a trace of the failure after a subsequent server startup. So, we had better avoid hitting the problem by simply not installing those signal handlers.
1 parent 0c77c5f commit 026984c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mysql-test/lib/My/Debugger.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ sub do_args($$$$$) {
147147
my %vars = (
148148
vardir => $::opt_vardir,
149149
exe => $$exe,
150-
args => join(' ', map { quote_from_mtr $_ } @$$args, '--loose-gdb'),
150+
args => join(' ', map { quote_from_mtr $_ } @$$args,
151+
'--loose-debug-gdb', '--loose-skip-stack-trace'),
151152
input => $input,
152153
script => "$::opt_vardir/tmp/${k}init.$type",
153154
log => "$::opt_vardir/log/$type.$k",

sql/mysqld.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9740,7 +9740,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
97409740
{
97419741
/* Allow break with SIGINT, no core or stack trace */
97429742
test_flags|= TEST_SIGINT;
9743-
opt_stack_trace= 1;
97449743
test_flags&= ~TEST_CORE_ON_SIGNAL;
97459744
}
97469745
/* Set global MyISAM variables from delay_key_write_options */

0 commit comments

Comments
 (0)