[Home]

Summary:ASTERISK-04470: [patch] cdr_addon_mysql crashes under heavy use
Reporter:j (j)Labels:
Date Opened:2005-06-23 13:04:40Date Closed:2005-06-23 13:41:23
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:CDR/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) cdr_addon_mysql.c.patch
Description:Greetings.

 During stress testing to solve a separate issue, I discovered a bug in the cdr_addon_mysql logging module. I can replicate it 100% of the time, and am submitting a patch to give the general idea of what is wrong....

 Quick Summary:
 If you are logging a cdr to a database with cdr_addon_mysql and at the same time reload the module (I assume the same issue will occur with unload, possibly load) the entire server will core dump.

 How I fixed it:
 I simply added mutex locking/unlocking to the reload command.
 I'm sure it could be done better, but I have tested my fix for this specific (reload) issue and it works flawlessly. It might be more appropriate to add the locking/unlocking to the individual load/unload commands instead; I will leave that decision to the experts ;)

  Feel free, of course, to use, modify, whatever, the patch I am supplying.
  I applied the patch to the cvs download of asterisk-addons today (June 23rd, 2005)

  Thanks.

j
Comments:By: Kevin P. Fleming (kpfleming) 2005-06-23 13:41:02

I've committed your patch, but with a number of changes, since it doesn't actually lock (it unlocks twice), and the formatting does not conform to the coding guidelines.

In the future, please follow the coding guidelines as closely as possible and ensure that your patch actually does what you intend it to do :-)