[asterisk-bugs] [Asterisk 0013213]: [patch] DAHDI mwi thread race conditions, sometimes crash or output wierd noises on the call

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Aug 20 16:55:29 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13213 
====================================================================== 
Reported By:                bbryant
Assigned To:                dbailey
====================================================================== 
Project:                    Asterisk
Issue ID:                   13213
Category:                   Channels/chan_dahdi
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 134352 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-07-31 18:04 CDT
Last Modified:              2008-08-20 16:55 CDT
====================================================================== 
Summary:                    [patch] DAHDI mwi thread race conditions, sometimes
crash or output wierd noises on the call
Description: 
DAHDI appears to have a race condition in do_monitor where it can spawn two
instances of mwi_send_data for the same dahdi_pvt structure if the ioctl
for DAHDI_MWT fails around line 7922. 

Attached is a backtrace of a crash that can occur with this issue.

My test environment is asterisk trunk r134352 and dahdi r4590 with a 4
port analog card. The test was just picking up the analog phone, and having
it drop into an immediate context that just played back a file.

Here are the debug messages, accompanied by 'dialup like' noises on the
analog phone:

[Jul 31 18:09:53] DEBUG[25958]: chan_dahdi.c:7914 do_monitor: Unable to
control message waiting led on channel 4: Inappropriate ioctl for device
[Jul 31 18:09:53] DEBUG[25963]: chan_dahdi.c:5558 dahdi_write: Dropping
frame since I've still got a callerid spill
[Jul 31 18:09:54] DEBUG[25963]: chan_dahdi.c:5558 dahdi_write: Dropping
frame since I've still got a callerid spill
[Jul 31 18:09:54] DEBUG[25963]: chan_dahdi.c:5558 dahdi_write: Dropping
frame since I've still got a callerid spill
[Jul 31 18:09:54] DEBUG[25963]: chan_dahdi.c:5558 dahdi_write: Dropping
frame since I've still got a callerid spill
[Jul 31 18:09:54] DEBUG[25963]: chan_dahdi.c:5558 dahdi_write: Dropping
frame since I've still got a callerid spill
[Jul 31 18:09:54] DEBUG[25963]: chan_dahdi.c:1954 restore_conference:
Restored conferencing
[Jul 31 18:09:54] WARNING[25962]: chan_dahdi.c:7543 mwi_send_thread: MWI
Send Write failed: Invalid argument

I've attempted a few wierd ways to fix it, but I think the patch just
creatively masking the problem instead of fixing it (still, I've attached
the patch because it makes it work).
====================================================================== 

---------------------------------------------------------------------- 
 (0091613) dbailey (administrator) - 2008-08-20 16:55
 http://bugs.digium.com/view.php?id=13213#c91613 
---------------------------------------------------------------------- 
A branch was made that has the mwi_send_thread functionality rolled back
into do_monitor.

The original mwi_send_thread was not releasing resources (such as in
do_monitor) when asterisk initiated calls were being made. This led to
resource conflicts which in tunr caused this error.

By rolling the functionality into do_monitor, only the do_monitor thread
need be killed to prevent the resource conflict.

https://svn.digium.com/svn/asterisk/team/dbailey/13213_mwi 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-20 16:55 dbailey        Note Added: 0091613                          
======================================================================




More information about the asterisk-bugs mailing list