[OpenSIPS-Users] crash / coredump with dispatcher module

Samuel Muller sml at l33.fr
Wed Mar 14 10:14:58 CET 2012


Hi Bogdan,

thanks a lot for the fix.

I confirm that the dispatcher module crashed if the modparam "use_default"
is set to 1 instead of 0 when there's no default destination set.
If set to 0, no crash anymore.

I'll add the patch this afternoon and test it again, but I'm sure it's fine
;)
have a good day !

best regards,

.Sam.

Samuel MULLER


On Tue, Mar 13, 2012 at 7:12 PM, Bogdan-Andrei Iancu <bogdan at opensips.org>wrote:

> **
> Hi Samuel,
>
> The fix is on SVN - so just update your code.
>
> Many thanks for reporting and troubleshooting this with me.
>
> Regards,
> Bogdan
>
>
> On 03/13/2012 07:34 PM, Samuel Muller wrote:
>
> Yep, it's what I tried.
>
> Actually, it's in a lab version, so I do several tests with 2 small
> servers.
>
> The big picture is :
>
> UA -> stateless proxies (with dispatcher) -> statefull+registrar proxy
>
> Later, the dispatcher will be used to send Register requests to 2
> different registrar servers, and Invite requests to 2 different statefull
> proxies.
>
> In this actual case, the dispatcher list file contains these lines :
>
> 1 sip:1.2.3.4:5060
> 2 sip:1.2.3.4:5060
> 3 sip:1.2.3.4:5060
> 4 sip:1.2.3.4:5060
>
> In the opensips config :
>
>
> modparam("dispatcher","list_file","/opt/opensips/etc/opensips/dispatcher.list")
> modparam("dispatcher","use_default",1)
> modparam("dispatcher","dst_avp","$avp(dp_dst)")
> modparam("dispatcher","attrs_avp","$avp(dp_attrs)")
> modparam("dispatcher","grp_avp","$avp(dp_grp)")
> modparam("dispatcher","cnt_avp","$avp(dp_cnt)")
> modparam("dispatcher","hash_pvar","$avp(dp_hash)")
> modparam("dispatcher","setid_pvar","$avp(dp_setid)")
> modparam("dispatcher","ds_ping_from","sip:sep1 at lab.toto.com")
> modparam("dispatcher","ds_ping_interval",15)
> modparam("dispatcher","ds_probing_mode",1)
>
> In the opensips routing logic, I would like to separate register and
> invite requests :
>
> route {
> ...
>     if (!is_method("REGISTER|MESSAGE")) {
>          record_route(";rr=edge");
>     }
>    if (is_method("REGISTER")) {
>         if (!ds_select_dst("1", "0")) {
>             ds_mark_dst("p");
>             ds_select_dst("2", "0");
>         }
>     }
>     if (is_method("INVITE")) {
>         if (!ds_select_dst("3", "0")) {
>             ds_mark_dst("p");
>             ds_select_dst("4", "0");
>         }
>     }
>     route(RELAY);
>     exit;
> }
>
> But, even if I change the routing logic with :
> ...
>     if (is_method("REGISTER")) {
>         ds_select_dst("1", "0");
>     }
>     if (is_method("INVITE")) {
>         ds_select_dst("3", "0");
>     }
> ...
>
> It happens the same crash, same reason.
>
> I'll change the "use_default" param to 0 and re-do tests.
>
>
> .Sam.
>
> Samuel MULLER
>
> On Tue, Mar 13, 2012 at 6:14 PM, Bogdan-Andrei Iancu <bogdan at opensips.org>wrote:
>
>>  Ok, that's the info I was looking for :)..
>>
>> Looking at that group, should I understand you have only one destination
>> in there, while having the  "use_default" on ? This makes a bit of none
>> sense - the group has only the default destination (to be used in case of
>> failure), but no regular destination ??
>>
>> Anyhow, there is a bug there, but I want to understand your setting, to
>> be sure that the fix will be the right one ;)
>>
>> Thanks and regards,
>> Bogdan
>>
>>
>> On 03/13/2012 04:51 PM, Samuel Muller wrote:
>>
>> oups, sorry ...
>>
>> (gdb) p *idx
>> $1 = {id = 1, nr = 1, last = 0, weight_sum = 0, dlist = 0x7f867d60b458,
>> next = 0x0}
>>
>> ;)
>>
>> .Sam.
>>
>> Samuel MULLER
>>
>>
>> On Tue, Mar 13, 2012 at 3:40 PM, Bogdan-Andrei Iancu <bogdan at opensips.org
>> > wrote:
>>
>>>  Hi Samuel,
>>>
>>> Print please "*idx" and not only "idx" - I need its content ;)
>>>
>>> Regards,
>>> Bogdan
>>>
>>>
>>> On 03/13/2012 04:35 PM, Samuel Muller wrote:
>>>
>>> Hello Bogdan,
>>>
>>> nice to see you again !
>>>
>>> here the stuff :
>>>
>>> [Thread debugging using libthread_db enabled]
>>> Core was generated by `/opt/opensips/sbin/opensips -P
>>> /opt/opensips/var/run/opensips.pid -m 256 -u sam'.
>>> Program terminated with signal 8, Arithmetic exception.
>>> #0  0x00007f26f086c513 in ds_select_dst (msg=0x80ebe8, set=<optimized
>>> out>, alg=0, mode=<optimized out>,
>>>     max_results=<optimized out>) at dispatch.c:1235
>>> 1235                i = (i+1)%(idx->nr-1);
>>>
>>> (gdb) p i
>>> $1 = 0
>>>
>>> (gdb) p idx
>>> $2 = (ds_set_p) 0x7f26dee90350
>>>
>>> (gdb) l
>>> 1230
>>> 1231        i=ds_id;
>>> 1232        while ( idx->dlist[i].flags&(DS_INACTIVE_DST|DS_PROBING_DST)
>>> )
>>> 1233        {
>>> 1234            if(ds_use_default!=0)
>>> 1235                i = (i+1)%(idx->nr-1);
>>> 1236            else
>>> 1237                i = (i+1)%idx->nr;
>>> 1238            if(i==ds_id)
>>> 1239            {
>>>
>>>
>>> I re-tested with a few modifications, like changing IPs in the
>>> dispatcher list file, or into the routing logic ("do it simple like in the
>>> docs examples"), the same problems still happens :/
>>>
>>> here's the corefile if needed :
>>> http://public.l33.fr/corefile.opensips.tar.gz
>>>
>>>
>>> Best regards,
>>>
>>> Samuel MULLER
>>>
>>>
>>>
>>> On Tue, Mar 13, 2012 at 2:51 PM, Bogdan-Andrei Iancu <
>>> bogdan at opensips.org> wrote:
>>>
>>>> Hello Samuel,
>>>>
>>>> In gdb, could you please print the '*idx' and 'i' variables ?
>>>>
>>>> Thanks and regards,
>>>> Bogdan
>>>>
>>>>
>>>>
>>>>
>>>> On 03/07/2012 03:34 PM, Samuel Muller wrote:
>>>>
>>>>>  Hey all,
>>>>>
>>>>> I got this crash when testing proxies availability with the dispatcher
>>>>> module :
>>>>>
>>>>> $ gdb  /opt/opensips/sbin/opensips core
>>>>>
>>>>> GNU gdb (GDB) 7.3-debian
>>>>> This GDB was configured as "x86_64-linux-gnu".
>>>>> Reading symbols from /opt/opensips/sbin/opensips...done.
>>>>> [New LWP 11580]
>>>>>
>>>>> [Thread debugging using libthread_db enabled]
>>>>> Core was generated by `/opt/opensips/sbin/opensips -P
>>>>> /opt/opensips/var/run/opensips.pid -m 256 -u sam'.
>>>>> Program terminated with signal 8, Arithmetic exception.
>>>>> #0  0x00007f87b9b54513 in ds_select_dst (msg=0x80f988, set=<optimized
>>>>> out>, alg=0,
>>>>>     mode=<optimized out>, max_results=<optimized out>) at
>>>>> dispatch.c:1235
>>>>> 1235                i = (i+1)%(idx->nr-1);
>>>>>
>>>>>
>>>>> in the opensips.cfg :
>>>>>
>>>>>
>>>>> modparam("dispatcher","list_file","/opt/opensips/etc/opensips/dispatcher.list")
>>>>> modparam("dispatcher","use_default",1)
>>>>> modparam("dispatcher","dst_avp","$avp(dp_dst)")
>>>>> modparam("dispatcher","attrs_avp","$avp(dp_attrs)")
>>>>> modparam("dispatcher","grp_avp","$avp(dp_grp)")
>>>>> modparam("dispatcher","cnt_avp","$avp(dp_cnt)")
>>>>> modparam("dispatcher","hash_pvar","$avp(dp_hash)")
>>>>> modparam("dispatcher","setid_pvar","$avp(dp_setid)")
>>>>> modparam("dispatcher","ds_ping_from","sip:edge at lab.com")
>>>>> modparam("dispatcher","ds_ping_interval",30)
>>>>> modparam("dispatcher","ds_probing_mode",1)
>>>>>
>>>>> route {
>>>>> ...
>>>>>     if (!is_method("REGISTER|MESSAGE")) {
>>>>>         record_route(";rr=edge");
>>>>>     }
>>>>>    if (is_method("REGISTER")) {
>>>>>         if (!ds_select_dst("1", "0")) {
>>>>>             ds_mark_dst("p");
>>>>>             ds_select_dst("2", "0");
>>>>>         }
>>>>>     }
>>>>>     if (is_method("INVITE")) {
>>>>>         if (!ds_select_dst("3", "0")) {
>>>>>             ds_mark_dst("p");
>>>>>             ds_select_dst("4", "0");
>>>>>         }
>>>>>     }
>>>>>     route(RELAY);
>>>>>     exit;
>>>>> }
>>>>>
>>>>>
>>>>> in the dispatcher.list :
>>>>>
>>>>> 1 sip:1.2.3.4:5060
>>>>> 2 sip:1.2.3.5:5060
>>>>> 3 sip:1.2.3.6:5060
>>>>> 4 sip:1.2.3.5:5060
>>>>>
>>>>> all is running under Debian last stable release + backports.
>>>>>
>>>>> I would like to know if it's my dispatcher configuration routine
>>>>> that's not correct, or if it's a module problem ?
>>>>>
>>>>> thank you,
>>>>>
>>>>>
>>>>> Samuel MULLER
>>>>>
>>>>>  _______________________________________________
>>>>> Users mailing list
>>>>> Users at lists.opensips.org
>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>>
>>>>
>>>> --
>>>> Bogdan-Andrei Iancu
>>>> OpenSIPS Founder and Developer
>>>> http://www.opensips-solutions.com
>>>>
>>>>
>>>
>>>
>>> --
>>> Bogdan-Andrei Iancu
>>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>>
>>>
>>
>>
>> --
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>
>>
>
>
> --
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120314/3f58b2fd/attachment-0001.htm>


More information about the Users mailing list