Skip to content
Permalink
Browse files
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
  • Loading branch information
vaintroub committed Nov 5, 2022
1 parent e7be2d3 commit 92be8d2
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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]);

0 comments on commit 92be8d2

Please sign in to comment.