summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2022-11-05 18:36:43 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2022-11-05 18:36:43 +0100
commit92be8d20480ee0e2fb8ec72c005648f2573558ce (patch)
treeb3d1f5e18c449176d70ecc223387ccac3a26bd59 /mysys
parente7be2d3142699aa73e8f50e01657a3ec2570c7ff (diff)
downloadmariadb-git-92be8d20480ee0e2fb8ec72c005648f2573558ce.tar.gz
MDEV-29951 server hang in crash handler
When trying to output stacktrace, and addr2line is not installed, the child process forked by start_addr2line_fork() will fail to do exec(), and finish with exit(1). There is a problem with exit() though - it runs exit handlers, and for the forked copy of crashing process, it is a bad idea. In 10.5+ code for example, exit handlers include tpool::task_group static destructors, and it will hang infinitely waiting for completion of the outstanding tasks. The fix is to use _exit() instead, which skips the execution of exit handlers
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_addr_resolve.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c
index f0c0d214171..ac1bdae187c 100644
--- a/mysys/my_addr_resolve.c
+++ b/mysys/my_addr_resolve.c
@@ -202,7 +202,7 @@ int start_addr2line_fork(const char *binary_path)
close(out[0]);
close(out[1]);
execlp("addr2line", "addr2line", "-C", "-f", "-e", binary_path, NULL);
- exit(1);
+ _exit(1);
}
close(in[0]);