Summary: | ASTERISK-17158: [patch] res_config_mysql.so crashes when processing "#include" with a file which doesn't exist | ||
Reporter: | Makoto Dei (makoto) | Labels: | |
Date Opened: | 2010-12-24 03:14:15.000-0600 | Date Closed: | 2011-01-06 00:29:10.000-0600 |
Priority: | Critical | Regression? | No |
Status: | Closed/Complete | Components: | Addons/res_config_mysql |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) bt.xt ( 1) res-config-mysql-include.patch | |
Description: | Step: 1. Add the following record to the realtime static table. filename extensions.conf category general var_name #include var_val /tmp/filedoesnotexist.txt 2. Restart Asterisk 3. Asterisk crashes Attached patch will fix the problem. | ||
Comments: | By: Tilghman Lesher (tilghman) 2010-12-24 11:48:02.000-0600 When you're reporting a crash, we need the stack backtrace in order to verify that the solution given is correct. By: Makoto Dei (makoto) 2011-01-05 19:24:01.000-0600 > When you're reporting a crash, we need the stack backtrace in order to verify that the solution given is correct. Attached. By: Makoto Dei (makoto) 2011-01-05 19:30:48.000-0600 ast_config_destroy is called at config_mysql() in res_config_mysql.c But this is also done at ast_config_load2() in main/config.c Then glibc detected double free and raised an exception. Attached patch removes calling ast_config_destroy at config_mysql() By: Digium Subversion (svnbot) 2011-01-06 00:26:53.000-0600 Repository: asterisk-addons Revision: 1141 U branches/1.6.2/res/res_config_mysql.c ------------------------------------------------------------------------ r1141 | tilghman | 2011-01-06 00:26:52 -0600 (Thu, 06 Jan 2011) | 8 lines Don't destroy a handle not created by us (because the caller will). (closes issue ASTERISK-17158) Reported by: makoto Patches: res-config-mysql-include.patch uploaded by makoto (license 38) Tested by: makoto ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk-addons?view=rev&revision=1141 By: Digium Subversion (svnbot) 2011-01-06 00:28:19.000-0600 Repository: asterisk Revision: 300798 U branches/1.8/addons/res_config_mysql.c ------------------------------------------------------------------------ r300798 | tilghman | 2011-01-06 00:28:19 -0600 (Thu, 06 Jan 2011) | 8 lines Don't destroy handle not created by use (because the caller will). (closes issue ASTERISK-17158) Reported by: makoto Patches: res-config-mysql-include.patch uploaded by makoto (license 38) Tested by: makoto ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=300798 By: Digium Subversion (svnbot) 2011-01-06 00:29:09.000-0600 Repository: asterisk Revision: 300799 _U trunk/ U trunk/addons/res_config_mysql.c ------------------------------------------------------------------------ r300799 | tilghman | 2011-01-06 00:29:09 -0600 (Thu, 06 Jan 2011) | 15 lines Merged revisions 300798 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r300798 | tilghman | 2011-01-06 00:28:18 -0600 (Thu, 06 Jan 2011) | 8 lines Don't destroy handle not created by use (because the caller will). (closes issue ASTERISK-17158) Reported by: makoto Patches: res-config-mysql-include.patch uploaded by makoto (license 38) Tested by: makoto ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=300799 |