[Home]

Summary:ASTERISK-10426: chan_sip crashes on reload
Reporter:hauke (hauke)Labels:
Date Opened:2007-10-02 03:13:45Date Closed:2007-10-02 07:11:48
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Doing a reload in CLI lets Asterisk crashing if chan_sip is loaded.


****** ADDITIONAL INFORMATION ******

This is my patch:
Index: chan_sip.c
===================================================================
--- chan_sip.c  (Revision 84050)
+++ chan_sip.c  (Arbeitskopie)
@@ -18912,7 +18912,10 @@
               ast_verbose("Previous SIP reload not yet done\n");
       else {
               sip_reloading = TRUE;
-               sip_reloadreason = a->fd ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
+               if(a && a->fd) {
+                 sip_reloadreason = a->fd ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
+               }
+
       }
       ast_mutex_unlock(&sip_reload_lock);
       restart_monitor();
Comments:By: Yuri (ys) 2007-10-02 03:24:09

The same in asterisk version 1.4.11

By: hauke (hauke) 2007-10-02 03:36:12

Well, I changed my little patch to:
Index: channels/chan_sip.c
===================================================================
--- channels/chan_sip.c (Revision 84050)
+++ channels/chan_sip.c (Arbeitskopie)
@@ -18912,7 +18912,12 @@
               ast_verbose("Previous SIP reload not yet done\n");
       else {
               sip_reloading = TRUE;
-               sip_reloadreason = a->fd ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
+               if(a) {
+                 sip_reloadreason = a->fd ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
+               } else {
+                 sip_reloadreason = CHANNEL_MODULE_RELOAD;
+               }
+
       }
       ast_mutex_unlock(&sip_reload_lock);
       restart_monitor();

I hope it's okay. here it works now :)

By: snuffy (snuffy) 2007-10-02 04:03:15

note hauke..
Any code/documentation should be uploaded as a file and the box ticked.
This way digium knows you have a signed a license to allow them to use your code.

By: hauke (hauke) 2007-10-02 04:14:30

snuffy, I know but here at work it is not allowed to send private faxes :-/
Maybe someone else who has signed offers the patch in a file.

By: phsultan (phsultan) 2007-10-02 07:10:40

It looks like this problem was reported and fixed here : http://bugs.digium.com/view.php?id=10831

Please test the latest available code, thanks for the report!