[Home]

Summary:ASTERISK-17665: [patch] 'voicemail show users for default' with a lot of entries in realtime voicemail cores asterisk
Reporter:Mikael Carlsson (mickecarlsson)Labels:
Date Opened:2011-04-10 06:34:38Date Closed:2011-05-05 15:29:43
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Addons/res_config_mysql
Versions:1.8.3 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bt_full.txt
( 1) bt.txt
( 2) bt-full-svn.txt
( 3) bt-svn.txt
( 4) issue19090_trunk_svn.patch
( 5) vm_database.txt
( 6) voicemail_users.sql
Description:I have 601 entries in the realtime voicemail database, all in context default.
When I type 'voicemail show users for default' asterisk cores.
Comments:By: Mikael Carlsson (mickecarlsson) 2011-04-10 06:36:15

mysql> select count(*) from voicemail_users;
+----------+
| count(*) |
+----------+
|      601 |
+----------+
1 row in set (0.00 sec)

By: Mikael Carlsson (mickecarlsson) 2011-04-10 06:47:49

extconfig.conf:
voicemail => mysql,asterisk,voicemail_users

res_mysql.conf:
[asterisk]
dbhost = 127.0.0.1
dbname = asterisk
dbuser = asteriskuser
dbpass = amp109

By: Sean Bright (seanbright) 2011-05-04 15:56:01

I'm not able to replicate this with the latest from the 1.8 branch or from trunk.  Could you upload a full data dump (with sensitive stuff masked for privacy)?

By: Mikael Carlsson (mickecarlsson) 2011-05-05 00:00:34

Sure, will do. Should I go with trunk or with branch?

By: Sean Bright (seanbright) 2011-05-05 06:17:27

Up to you.

By: Mikael Carlsson (mickecarlsson) 2011-05-05 12:26:32

I checked out SVN-trunk-r316920
Added 500 users to the database, it worked. I added 500 more users. Asterisk cored. I will now remove 100 a time to see where it stops core.

As I am using bogus data on a non-production server, I can upload the sql-database for you to use in your test.

By: Mikael Carlsson (mickecarlsson) 2011-05-05 12:48:16

mysql> select count(*) from voicemail_users;
+----------+
| count(*) |
+----------+
|      638 |
+----------+
1 row in set (0.00 sec)

If I add one more record so that the count is 639 asterisk cores, if I remove one entry so it is 638 it will work.

By: Mikael Carlsson (mickecarlsson) 2011-05-05 12:56:59

Note that I removed the customer_id column as it was not needed.

By: Sean Bright (seanbright) 2011-05-05 13:01:35

Yes.  Zip up a data dump and attach it.  If you exceed the attachment size limit you can e-mail it to me directly.

<b>EDIT:</b> Just noticed that you already did this.  Please ignore.



By: Sean Bright (seanbright) 2011-05-05 13:02:02

FWIW I tested with 2000 records and had no problem... so maybe I didn't have enough other data in the table.

By: Sean Bright (seanbright) 2011-05-05 13:04:26

Crashing in calloc() might signal memory corruption.  Any chance you'd run a test under valgrind?  See instructions at https://wiki.asterisk.org/wiki/display/AST/Valgrind

By: Sean Bright (seanbright) 2011-05-05 13:25:08

I got it to crash finally, just threw 10000 users at it.  Will let you know what I find.

By: Sean Bright (seanbright) 2011-05-05 14:05:45

Patch for trunk attached.  Please test and report your results.


By: Mikael Carlsson (mickecarlsson) 2011-05-05 14:36:08

Yes, that fixed it.
I tested to add 1900 users, no issues detected, just scrolled all users when command was entered.

Thank you.

By: Digium Subversion (svnbot) 2011-05-05 15:23:55

Repository: asterisk-addons
Revision: 1151

U   branches/1.6.2/res/res_config_mysql.c

------------------------------------------------------------------------
r1151 | seanbright | 2011-05-05 15:23:54 -0500 (Thu, 05 May 2011) | 10 lines

Don't duplicate our data on the stack and just use the MYSQL_ROW directly.

With large result sets we were blowing out the stack.

(closes issue ASTERISK-17665)
Reported by: mickecarlsson
Patches:
     issue19090_trunk_svn.patch uploaded by seanbright (license 71)
Tested by: mickecarlsson

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk-addons?view=rev&revision=1151

By: Digium Subversion (svnbot) 2011-05-05 15:25:55

Repository: asterisk
Revision: 317370

U   branches/1.8/addons/res_config_mysql.c

------------------------------------------------------------------------
r317370 | seanbright | 2011-05-05 15:25:55 -0500 (Thu, 05 May 2011) | 10 lines

Don't duplicate our data on the stack and just use the MYSQL_ROW directly.

With large result sets we were blowing out the stack.

(closes issue ASTERISK-17665)
Reported by: mickecarlsson
Patches:
     issue19090_trunk_svn.patch uploaded by seanbright (license 71)
Tested by: mickecarlsson

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=317370

By: Digium Subversion (svnbot) 2011-05-05 15:27:26

Repository: asterisk
Revision: 317377

_U  trunk/
U   trunk/addons/res_config_mysql.c

------------------------------------------------------------------------
r317377 | seanbright | 2011-05-05 15:27:26 -0500 (Thu, 05 May 2011) | 17 lines

Merged revisions 317370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 r317370 | seanbright | 2011-05-05 16:25:52 -0400 (Thu, 05 May 2011) | 10 lines
 
 Don't duplicate our data on the stack and just use the MYSQL_ROW directly.
 
 With large result sets we were blowing out the stack.
 
 (closes issue ASTERISK-17665)
 Reported by: mickecarlsson
 Patches:
       issue19090_trunk_svn.patch uploaded by seanbright (license 71)
 Tested by: mickecarlsson
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=317377