[SR-Users] kamailio 4.2 ,have some problems when use mysql db

Gonzalo Gasca gascagonzalo at gmail.com
Tue Oct 21 08:04:53 CEST 2014


Interestingly you only have 1 record in your dispatcher table. My guess was
a huge number of dispatcher records.

What do you have in that rule? Maybe some special characters?

Can you send:

mysql> select * from dispatcher;

mysql> desc dispatcher;

+-------------+------------------+------+-----+---------+----------------+

| Field       | Type             | Null | Key | Default | Extra          |

+-------------+------------------+------+-----+---------+----------------+

| id          | int(10) unsigned | NO   | PRI | NULL    | auto_increment |

| setid       | int(11)          | NO   |     | 0       |                |

| destination | varchar(192)     | NO   |     |         |                |

| flags       | int(11)          | NO   |     | 0       |                |

| priority    | int(11)          | NO   |     | 0       |                |

| attrs       | varchar(128)     | NO   |     |         |                |

| description | varchar(64)      | NO   |     |         |                |

+-------------+------------------+------+-----+---------+----------------+

On Mon, Oct 20, 2014 at 4:15 PM, 张顺通 <shuntongzhang at gmail.com> wrote:

> mysql> desc version;
> +---------------+------------------+------+-----+---------+-------+
> | Field         | Type             | Null | Key | Default | Extra |
> +---------------+------------------+------+-----+---------+-------+
> | table_name    | varchar(32)      | NO   | PRI | NULL    |       |
> | table_version | int(10) unsigned | NO   |     | 0       |       |
> +---------------+------------------+------+-----+---------+-------+
> 2 rows in set (0.00 sec)
> mysql> select count(*) from version;
> +----------+
> | count(*) |
> +----------+
> |       26 |
> +----------+
> 1 row in set (0.00 sec)
>
> mysql> select * from version;
> +-----------------+---------------+
> | table_name      | table_version |
> +-----------------+---------------+
> | acc             |             4 |
> | acc_cdrs        |             1 |
> | address         |             6 |
> | aliases         |             6 |
> | dbaliases       |             1 |
> | dialog          |             7 |
> | dialog_vars     |             1 |
> | dialplan        |             1 |
> | dispatcher      |             4 |
> | domain          |             2 |
> | domain_attrs    |             1 |
> | grp             |             2 |
> | lcr_gw          |             3 |
> | lcr_rule        |             2 |
> | lcr_rule_target |             1 |
> | location        |             6 |
> | location_attrs  |             1 |
> | missed_calls    |             3 |
> | pdt             |             1 |
> | re_grp          |             1 |
> | silo            |             7 |
> | speed_dial      |             2 |
> | subscriber      |             6 |
> | trusted         |             5 |
> | uri             |             1 |
> | usr_preferences |             2 |
> +-----------------+---------------+
> 26 rows in set (0.01 sec)
> mysql> select count(*) from dispatcher;
> +----------+
> | count(*) |
> +----------+
> |        1 |
> +----------+
> 1 row in set (0.01 sec)
>
>
>  # ----- dispatcher params -----
>  modparam("dispatcher", "db_url", DBURL)
>
> I try local & remote db at the same time, all do not work.
>
> 2014-10-21 6:47 GMT+08:00 Gonzalo Gasca <gascagonzalo at gmail.com>:
>
>> Hi Shuntongzhang,
>>
>> As Daniel mentioned we can see the error during* pkg_malloc*
>> db_res.c: db_new_result(112) (db_res.c#L112)
>>
>>
>> https://github.com/kamailio/kamailio/blob/fcdf5f9cfff634ebfa736d7084d5e5483a36355b/lib/srdb1/db_res.c#L112
>>
>> As I mentioned before can you provide the results of the query for
>> version table and dispatcher table. Seems to be an issue storing the results
>>
>>         __FUNCTION__ = "db_mysql_store_result"
>> #7  0x00007ffff5fd3516 in db_do_query_internal (_h=0x7ffff6cb4e78,
>> _k=0x7fffffffdf70, _op=0x0, _v=0x7fffffffdf40, _c=0x7fffffffdf60, _n=1,
>> _nc=1, _o=0x0,
>>     _r=0x7fffffffdf38, val2str=0x7ffff6a39374 <db_mysql_val2str>,
>> submit_query=0x7ffff6a2825c <db_mysql_submit_query>,
>>     store_result=0x7ffff6a2998c <db_mysql_store_result>, _l=0) at
>> db_query.c:137
>>    *     tmp = 32767*
>>         off = 63
>>         ret = 23
>>
>> a) Can you provide the results for:
>>
>> mysql -h localhost -P 3306 -u root -p
>>
>> mysql> use kamailiodb; <Use your kamailio Db name here>
>>
>> mysql>desc version;
>>
>> mysql> select count(*) from version;
>> mysql> select * from version;
>>
>> mysql> select count(*) from dispatcher;
>>
>> This will help us to see how many entries in dispatcher table.
>>
>> b) Can you provide dispatcher config for kamailio.cfg ?
>> c) Is the SQL db server local or in a remote server?
>>
>> /G
>>
>>
>> On Mon, Oct 20, 2014 at 8:01 AM, 张顺通 <shuntongzhang at gmail.com> wrote:
>>
>>> I install a rehl 5.7 by myself, kamailio 4.1.6 can run correctly. but it
>>> can not run on out company's server which is also rehl 5.7. How to find the
>>> problem.I have no idea.
>>> anyone can help?
>>> thks
>>>
>>> 2014-10-20 19:39 GMT+08:00 张顺通 <shuntongzhang at gmail.com>:
>>>
>>>> db_new_result->pkg_malloc(qm_malloc)->qm_find_free, func qm_find_free
>>>> return 0, can not find mem when i close memdbg.
>>>>
>>>> 2014-10-20 18:57 GMT+08:00 张顺通 <shuntongzhang at gmail.com>:
>>>>
>>>>> rhel5
>>>>> $cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
>>>>>      24  Intel(R) Xeon(R) CPU E5-2430 0 @ 2.20GHz
>>>>> rhel6
>>>>> cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
>>>>>      16  Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
>>>>>
>>>>> not Embedded device, normal server.
>>>>>
>>>>>
>>>>> gdb
>>>>>
>>>>> (gdb) f 2
>>>>> #2  0x0000000000615b74 in qm_debug_frag (qm=0x7ffff6c55010,
>>>>> f=0x7ffff6cdcf08) at mem/q_malloc.c:161
>>>>> 161                     abort();
>>>>> (gdb) p *f
>>>>> $1 = {size = 7831720, u = {nxt_free = 0x7ffff6c893f8, is_free =
>>>>> 140737333728248}, file = 0x7ffff6a4c93d "db_mysql: km_my_con.c",
>>>>>   func = 0x758307 "fragm. from qm_malloc", line = 62, check =
>>>>> 4042322160}
>>>>>
>>>>>
>>>>> 2014-10-20 18:30 GMT+08:00 Daniel-Constantin Mierla <miconda at gmail.com
>>>>> >:
>>>>>
>>>>>>  physical machine is the same? Is it standard OS installation, or
>>>>>> some customizations (e.g. custom kernel modules, etc.)? Embedded device?
>>>>>> What CPU?
>>>>>>
>>>>>> Daniel
>>>>>>
>>>>>>
>>>>>> On 20/10/14 12:24, 张顺通 wrote:
>>>>>>
>>>>>> os is rhel.
>>>>>> rhel6 is ok, rhel5 can not start.
>>>>>>
>>>>>> 2014-10-20 18:11 GMT+08:00 Daniel-Constantin Mierla <
>>>>>> miconda at gmail.com>:
>>>>>>
>>>>>>>  What are the differences between the server that works and the one
>>>>>>> that doesn't? I mean hardware and operating system details?
>>>>>>>
>>>>>>> Checking quickly the source code and comparing with logs, it doesn't
>>>>>>> reveal any problem -- it is about allocation of the next fragment, which
>>>>>>> was not used at all before, after the one allocated previously. The only
>>>>>>> reason I can think of it right now is corrupted memory or faulty OS.
>>>>>>>
>>>>>>> Daniel
>>>>>>>
>>>>>>>
>>>>>>> On 20/10/14 11:56, 张顺通 wrote:
>>>>>>>
>>>>>>>  4.2 have the same problem.
>>>>>>>  at begin i use 4.1, i think this is a bug in 4.1;  then i use 4.2
>>>>>>> to check to see if the problem is solved. problems still in.
>>>>>>>
>>>>>>> see ka_4_2_0.log
>>>>>>>>>>>>>>  ka_4_2_0.log
>>>>>>> <https://docs.google.com/file/d/0B5x1TDtoeVvAckdMbDRmT3E3UjA/edit?usp=drive_web>
>>>>>>>>>>>>>>
>>>>>>> 2014-10-20 17:48 GMT+08:00 张顺通 <shuntongzhang at gmail.com>:
>>>>>>>
>>>>>>>>  ka.log is genrate by kamailio 4.1.6.
>>>>>>>>
>>>>>>>> 2014-10-20 17:44 GMT+08:00 Daniel-Constantin Mierla <
>>>>>>>> miconda at gmail.com>:
>>>>>>>>
>>>>>>>>> Are you using 4.1 or 4.2?
>>>>>>>>>
>>>>>>>>> Because the subject mentioned 4.2 but the version of kamailio is
>>>>>>>>> 4.1
>>>>>>>>>
>>>>>>>>> Daniel
>>>>>>>>>
>>>>>>>>> On 20/10/14 11:39, 张顺通 wrote:
>>>>>>>>> > -M 12 can not help. all config is same.
>>>>>>>>> >
>>>>>>>>> > see ka.log in attachment, kamailio version is 4.1.6
>>>>>>>>> >
>>>>>>>>> > version: kamailio 4.1.6 (x86_64/linux) 010d57
>>>>>>>>> >
>>>>>>>>> > flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
>>>>>>>>> > DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
>>>>>>>>> PKG_MALLOC,
>>>>>>>>> > DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
>>>>>>>>> > USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
>>>>>>>>> >
>>>>>>>>> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144,
>>>>>>>>> MAX_LISTEN 16,
>>>>>>>>> > MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
>>>>>>>>> >
>>>>>>>>> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>>>>>>>>> >
>>>>>>>>> > id: 010d57
>>>>>>>>> >
>>>>>>>>> > compiled on 16:48:03 Oct 20 2014 with gcc 4.1.2
>>>>>>>>> >
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>>  --
>>>>>>>>> Daniel-Constantin Mierla
>>>>>>>>> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20141020/7cbbfb24/attachment.html>


More information about the sr-users mailing list