[Home]

Summary:ASTERISK-25825: Crashes during shutdown when running CLI commands
Reporter:Mark Michelson (mmichelson)Labels:
Date Opened:2016-03-01 12:21:02.000-0600Date Closed:2016-03-24 19:21:13
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Attachments:( 0) chanlist_bt.txt
Description:During some test runs, we've witnessed crashes occur during Asterisk shutdown when certain CLI commands are run. Attached are some backtraces from such crashes.

The trend is that shutdown tends to NULL out or destroy structures that CLI commands may be relying on.
Comments:By: Rusty Newton (rnewton) 2016-03-01 15:11:30.938-0600

Fun!

By: Rusty Newton (rnewton) 2016-03-01 15:13:03.583-0600

Happens in 11 and 13+ ?

By: Corey Farrell (coreyfarrell) 2016-03-15 17:27:52.290-0500

Sorry I was slow to look at this I was busy then had the flu.  I feel that the issue here is startup and shutdown order being wrong.  For example 'core show channels' and related commands maybe should be moved to stasis_channels.c or another more appropriate source.  If registered at the correct time during startup these commands will be unregistered before they become unsafe.  It's also worth acknowledging that the current startup order means it is theoretically possible to run 'core show channels' before it's safe.

One quick fix would be to just move {{ast_builtins_init}} later in the initialization.  Obviously there may be other units that are inappropriately initialized before stasis or other dependencies, but I think they should each be looked at individually.