[asterisk-bugs] [Asterisk 0016335]: [patch] Asterisk crashes randomly on mISDN RELEASE_COMPLETE

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Dec 7 04:37:08 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16335 
====================================================================== 
Reported By:                azielke
Assigned To:                rmudgett
====================================================================== 
Project:                    Asterisk
Issue ID:                   16335
Category:                   Channels/chan_misdn
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.6.1.10 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-11-27 07:35 CST
Last Modified:              2009-12-07 04:37 CST
====================================================================== 
Summary:                    [patch] Asterisk crashes randomly on mISDN
RELEASE_COMPLETE
Description: 
I experienced random crashes on an asterisk when an Call over mISDN is hung
up.

The backtrace for the crash always looked similar (see attachment), so i
check the source.
I noticed that there is a check for ch->need_queue_hangup, but it would
just print a message and continue executing the rest of the code.
The fix seems really trivial, but tests show that the asterisk didn't
crash anymore.
====================================================================== 

---------------------------------------------------------------------- 
 (0114826) sodom (reporter) - 2009-12-07 04:37
 https://issues.asterisk.org/view.php?id=16335#c114826 
---------------------------------------------------------------------- 
That patch didn't removes the crash, maybe it reduces it's occourance, on
my side.

I hunt the hangup crash issue quite some time now and maybe i found the
problem. Sometimes mISDN tries to set the state of ast to DOWN at the end
of the channel release process. That is done even if the approbiate
functions to hangup/relase ast are called priviously. The code segment
where the DOWN state is set is at the end of the release_chan method and
seems to be some king of safety to put the ast state to DOWN if something
else priviously went wrong. I think that ast isn't valid at this time any
more and so the simple state change crashes asterisk as ast isn't valid any
more.
I tried to counter the crash in checking for the DOWN state priviously but
that doesn't work. So i removed the complete code segement and since then
the problem seem to be gone.
It's a little guessing as the last line in my misnd log in a case of a
crash seem to be the " --> Setting AST State to down" statement.

I don't know if the problem is realy fixed and to be true i don't
understand why this safety code segment is there, like it is. I would offer
a patch but my state of the chan_misdn.c is different from all normal
states so i could not offer a real patch. I show you the codesegemt to
remove. (Added multiple patches from here to my 1.4.26 version to counter
that problem also i'am using the transfer patch, so my sources are rather
unique.)

if (ast && MISDN_ASTERISK_TECH_PVT(ast)) {
  chan_misdn_log(1, bc->port, "* RELEASING CHANNEL pid:%d ctx:%s dad:%s
oad:%s state: %s\n", bc ? bc->pid : -1, ast->context, ast->exten,
ast->cid.cid_num, misdn_get_ch_state(ch));
  chan_misdn_log(3, bc->port, " --> * State Down\n");
  MISDN_ASTERISK_TECH_PVT(ast) = NULL;

  if (ast->_state != AST_STATE_RESERVED) {
    chan_misdn_log(3, bc->port, " --> Setting AST State to down\n");
    ast_setstate(ast, AST_STATE_DOWN);
  }
} 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-12-07 04:37 sodom          Note Added: 0114826                          
======================================================================




More information about the asterisk-bugs mailing list