Hi Bogdan,<br><br>thanks a lot for the fix.<br><br>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.<br>If set to 0, no crash anymore.<br>
<br>I'll add the patch this afternoon and test it again, but I'm sure it's fine ;)<br>have a good day !<br><br>best regards,<br><br>.Sam.<br><br>Samuel MULLER<br><br><br><div class="gmail_quote">On Tue, Mar 13, 2012 at 7:12 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div bgcolor="#ffffff" text="#000000">
Hi Samuel,<br>
<br>
The fix is on SVN - so just update your code.<br>
<br>
Many thanks for reporting and troubleshooting this with me.<br>
<br>
Regards,<br>
Bogdan<div><div class="h5"><br>
<br>
On 03/13/2012 07:34 PM, Samuel Muller wrote:
<blockquote type="cite">Yep, it's what I tried.<br>
<br>
Actually, it's in a lab version, so I do several tests with 2
small servers.<br>
<br>
The big picture is :<br>
<br>
UA -> stateless proxies (with dispatcher) ->
statefull+registrar proxy<br>
<br>
Later, the dispatcher will be used to send Register requests to 2
different registrar servers, and Invite requests to 2 different
statefull proxies.<br>
<br>
In this actual case, the dispatcher list file contains these lines
:<br>
<br>
1 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
2 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
3 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
4 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
<br>
In the opensips config :<br>
<br>
modparam("dispatcher","list_file","/opt/opensips/etc/opensips/dispatcher.list")<br>
modparam("dispatcher","use_default",1)<br>
modparam("dispatcher","dst_avp","$avp(dp_dst)")<br>
modparam("dispatcher","attrs_avp","$avp(dp_attrs)")<br>
modparam("dispatcher","grp_avp","$avp(dp_grp)")<br>
modparam("dispatcher","cnt_avp","$avp(dp_cnt)")<br>
modparam("dispatcher","hash_pvar","$avp(dp_hash)")<br>
modparam("dispatcher","setid_pvar","$avp(dp_setid)")<br>
modparam("dispatcher","ds_ping_from","<a href="mailto:sip%3Asep1@lab.toto.com" target="_blank">sip:sep1@lab.toto.com</a>")<br>
modparam("dispatcher","ds_ping_interval",15)<br>
modparam("dispatcher","ds_probing_mode",1)<br>
<br>
In the opensips routing logic, I would like to separate register
and invite requests :<br>
<br>
route {<br>
...<br>
if (!is_method("REGISTER|MESSAGE")) {<br>
<div> record_route(";rr=edge");<br>
}<br>
if (is_method("REGISTER")) {<br>
if (!ds_select_dst("1", "0")) {<br>
ds_mark_dst("p");<br>
ds_select_dst("2", "0");<br>
}<br>
}<br>
if (is_method("INVITE")) {<br>
if (!ds_select_dst("3", "0")) {<br>
ds_mark_dst("p");<br>
ds_select_dst("4", "0");<br>
}<br>
}<br>
route(RELAY);<br>
exit;<br>
}</div>
<br>
But, even if I change the routing logic with :<br>
...<br>
if (is_method("REGISTER")) {<br>
ds_select_dst("1", "0");<br>
}<br>
if (is_method("INVITE")) {<br>
ds_select_dst("3", "0");<br>
}<br>
...<br>
<br>
It happens the same crash, same reason.<br>
<br>
I'll change the "use_default" param to 0 and re-do tests.<br>
<br>
<br clear="all">
.Sam.<br>
<br>
Samuel MULLER<br>
<br>
<div class="gmail_quote">On Tue, Mar 13, 2012 at 6:14 PM,
Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#ffffff" text="#000000"> Ok, that's the info I
was looking for :)..<br>
<br>
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 ??<br>
<br>
Anyhow, there is a bug there, but I want to understand your
setting, to be sure that the fix will be the right one ;)<br>
<br>
Thanks and regards,<br>
Bogdan
<div>
<div><br>
<br>
On 03/13/2012 04:51 PM, Samuel Muller wrote:
<blockquote type="cite">oups, sorry ...<br>
<br>
(gdb) p *idx<br>
$1 = {id = 1, nr = 1, last = 0, weight_sum = 0, dlist
= 0x7f867d60b458, next = 0x0}<br>
<br>
;)<br>
<br>
.Sam.<br clear="all">
<br>
Samuel MULLER<br>
<br>
<br>
<div class="gmail_quote">On Tue, Mar 13, 2012 at 3:40
PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#ffffff" text="#000000"> Hi Samuel,<br>
<br>
Print please "*idx" and not only "idx" - I need
its content ;)<br>
<br>
Regards,<br>
Bogdan
<div>
<div><br>
<br>
On 03/13/2012 04:35 PM, Samuel Muller wrote:
<blockquote type="cite">Hello Bogdan,<br>
<br>
nice to see you again !<br clear="all">
<br>
here the stuff :<br>
<br>
[Thread debugging using libthread_db
enabled]<br>
Core was generated by
`/opt/opensips/sbin/opensips -P
/opt/opensips/var/run/opensips.pid -m 256
-u sam'.<br>
Program terminated with signal 8,
Arithmetic exception.<br>
#0 0x00007f26f086c513 in ds_select_dst
(msg=0x80ebe8, set=<optimized out>,
alg=0, mode=<optimized out>, <br>
max_results=<optimized out>) at
dispatch.c:1235<br>
1235 i =
(i+1)%(idx->nr-1);<br>
<br>
(gdb) p i<br>
$1 = 0<br>
<br>
(gdb) p idx<br>
$2 = (ds_set_p) 0x7f26dee90350<br>
<br>
(gdb) l<br>
1230 <br>
1231 i=ds_id;<br>
1232 while (
idx->dlist[i].flags&(DS_INACTIVE_DST|DS_PROBING_DST)
)<br>
1233 {<br>
1234 if(ds_use_default!=0)<br>
1235 i =
(i+1)%(idx->nr-1);<br>
1236 else<br>
1237 i = (i+1)%idx->nr;<br>
1238 if(i==ds_id)<br>
1239 {<br>
<br>
<br>
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 :/<br>
<br>
here's the corefile if needed : <a href="http://public.l33.fr/corefile.opensips.tar.gz" target="_blank">http://public.l33.fr/corefile.opensips.tar.gz</a><br>
<br>
<br>
Best regards,<br>
<br>
Samuel MULLER<br>
<br>
<br>
<br>
<div class="gmail_quote">On Tue, Mar 13,
2012 at 2:51 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Hello
Samuel,<br>
<br>
In gdb, could you please print the
'*idx' and 'i' variables ?<br>
<br>
Thanks and regards,<br>
Bogdan
<div>
<div><br>
<br>
<br>
<br>
On 03/07/2012 03:34 PM, Samuel
Muller wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div> Hey all,<br>
<br>
I got this crash when testing
proxies availability with the
dispatcher module :<br>
<br>
$ gdb
/opt/opensips/sbin/opensips
core<br>
<br>
GNU gdb (GDB) 7.3-debian<br>
This GDB was configured as
"x86_64-linux-gnu".<br>
Reading symbols from
/opt/opensips/sbin/opensips...done.<br>
[New LWP 11580]<br>
<br>
[Thread debugging using
libthread_db enabled]<br>
Core was generated by
`/opt/opensips/sbin/opensips -P<br>
/opt/opensips/var/run/opensips.pid
-m 256 -u sam'.<br>
Program terminated with signal
8, Arithmetic exception.<br>
#0 0x00007f87b9b54513 in
ds_select_dst (msg=0x80f988,
set=<optimized<br>
out>, alg=0,<br>
mode=<optimized out>,
max_results=<optimized
out>) at dispatch.c:1235<br>
1235 i =
(i+1)%(idx->nr-1);<br>
<br>
<br>
in the opensips.cfg :<br>
<br>
modparam("dispatcher","list_file","/opt/opensips/etc/opensips/dispatcher.list")<br>
modparam("dispatcher","use_default",1)<br>
modparam("dispatcher","dst_avp","$avp(dp_dst)")<br>
modparam("dispatcher","attrs_avp","$avp(dp_attrs)")<br>
modparam("dispatcher","grp_avp","$avp(dp_grp)")<br>
modparam("dispatcher","cnt_avp","$avp(dp_cnt)")<br>
modparam("dispatcher","hash_pvar","$avp(dp_hash)")<br>
modparam("dispatcher","setid_pvar","$avp(dp_setid)")<br>
modparam("dispatcher","ds_ping_from","<a href="mailto:sip%3Aedge@lab.com" target="_blank">sip:edge@lab.com</a>")<br>
modparam("dispatcher","ds_ping_interval",30)<br>
modparam("dispatcher","ds_probing_mode",1)<br>
<br>
route {<br>
...<br>
if
(!is_method("REGISTER|MESSAGE"))
{<br>
record_route(";rr=edge");<br>
}<br>
if (is_method("REGISTER")) {<br>
if (!ds_select_dst("1",
"0")) {<br>
ds_mark_dst("p");<br>
ds_select_dst("2",
"0");<br>
}<br>
}<br>
if (is_method("INVITE")) {<br>
if (!ds_select_dst("3",
"0")) {<br>
ds_mark_dst("p");<br>
ds_select_dst("4",
"0");<br>
}<br>
}<br>
route(RELAY);<br>
exit;<br>
}<br>
<br>
<br>
in the dispatcher.list :<br>
<br>
1 sip:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a><br>
2 sip:<a href="http://1.2.3.5:5060" target="_blank">1.2.3.5:5060</a><br>
3 sip:<a href="http://1.2.3.6:5060" target="_blank">1.2.3.6:5060</a><br>
4 sip:<a href="http://1.2.3.5:5060" target="_blank">1.2.3.5:5060</a><br>
<br>
all is running under Debian last
stable release + backports.<br>
<br>
I would like to know if it's my
dispatcher configuration routine<br>
that's not correct, or if it's a
module problem ?<br>
<br>
thank you,<br>
<br>
<br>
Samuel MULLER<br>
<br>
</div>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<span><font color="#888888"> </font></span></blockquote>
<span><font color="#888888"> <br>
<br>
-- <br>
Bogdan-Andrei Iancu<br>
OpenSIPS Founder and Developer<br>
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a><br>
<br>
</font></span></blockquote>
</div>
<br>
</blockquote>
<br>
<br>
<pre cols="72">--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</blockquote>
<br>
<br>
<pre cols="72">--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</blockquote>
<br>
<br>
<pre cols="72">--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
</div></div></div>
</blockquote></div><br>