From 89e94e886c8d2a3bf31eae50d838afc2c26906f9 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Thu, 10 Mar 2016 16:58:49 -0600 Subject: Restrict CLI/AMI commands on shutdown. During stress testing, we have frequently seen crashes occur because a CLI or AMI command attempts to access information that is in the process of being destroyed. When addressing how to fix this issue, we initially considered fixing individual crashes we observed. However, the changes required to fix those problems would introduce considerable overhead to the nominal case. This is not reasonable in order to prevent a crash from occurring while Asterisk is already shutting down. Instead, this change makes it so AMI and CLI commands cannot be executed if Asterisk is being shut down. For AMI, this is absolute. For CLI, though, certain commands can be registered so that they may be run during Asterisk shutdown. ASTERISK-25825 #close Change-Id: I8887e215ac352fadf7f4c1e082da9089b1421990 --- main/utils.c | 1 + 1 file changed, 1 insertion(+) (limited to 'main/utils.c') diff --git a/main/utils.c b/main/utils.c index 8a9f91062..6a778b90c 100644 --- a/main/utils.c +++ b/main/utils.c @@ -1153,6 +1153,7 @@ static char *handle_show_locks(struct ast_cli_entry *e, int cmd, struct ast_cli_ "Usage: core show locks\n" " This command is for lock debugging. It prints out which locks\n" "are owned by each active thread.\n"; + ast_cli_allow_on_shutdown(e); return NULL; case CLI_GENERATE: -- cgit v1.2.3