No, it still crashes without STUN :( I'll try mem debug later.<br><br>Core was generated by `./opensips -u opensips'.<br>Program terminated with signal 11, Segmentation fault.<br>[New process 17406]<br>#0 0x080ec3d9 in fm_malloc (qm=0x81b3c00, size=<value optimized out>) at mem/f_malloc.c:172<br>
172 *pf=n->u.nxt_free;<br>(gdb) where<br>#0 0x080ec3d9 in fm_malloc (qm=0x81b3c00, size=<value optimized out>) at mem/f_malloc.c:172<br>#1 0x00f20d04 in build_rr (_l=0x81d52e8, _l2=0x81d5a38, user=0xbff01190, tag=0x81d79d0, params=0x0, _inbound=1) at record.c:163<br>
#2 0x00f2171f in record_route (_m=0x81d1bec, params=0x0) at record.c:320<br>#3 0x00f23031 in w_record_route (msg=0x81d1bec, key=0x0, bar=0x0) at rr_mod.c:272<br>#4 0x080545dd in do_action (a=0x81bdb2c, msg=0x81d1bec) at action.c:967<br>
#5 0x08057308 in run_action_list (a=0x81bdb2c, msg=0x81d1bec) at action.c:139<br>#6 0x080554dd in do_action (a=0x81bdb98, msg=0x81d1bec) at action.c:706<br>#7 0x08057308 in run_action_list (a=0x81bd578, msg=0x81d1bec) at action.c:139<br>
#8 0x080576a3 in run_top_route (a=0x81bd578, msg=0x81d1bec) at action.c:119<br>#9 0x0809ddf2 in receive_msg (<br> buf=0x8192380 "OPTIONS sip:<a href="http://Sip.comtube.ru">Sip.comtube.ru</a> SIP/2.0\r\nVia: SIP/2.0/UDP 93.185.192.234:5060;branch=z9hG4bK30bf0ee2;rport\r\nFrom: \"Unknown\" <<a href="mailto:sip%3AUnknown@93.185.192.234">sip:Unknown@93.185.192.234</a>>;tag=as16669a6b\r\nTo: <sip:<a href="http://Sip.comtube.ru">Sip.comtube.ru</a>>\r\nContact: <"..., len=495, rcv_info=0xbff01894) at receive.c:162<br>
#10 0x080e5056 in udp_rcv_loop () at udp_server.c:492<br>#11 0x08070adf in main (argc=5, argv=0xbff01aa4) at main.c:821<br><br><div class="gmail_quote">2009/12/27 Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Alexander,<br>
<br>
I fixed the second one :). Before trying the mem debugger, try running 1.6.1 without the stun module - maybe the crashes you see are side effects of the bug in the stun module.<br>
<br>
Regards,<br>
Bogdan<br>
<br>
Alexander wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello.<br>
<br>
Regarding STUN - it seems that there is the same bug on line 870. Again,<br>
iterator b2 is created before memory allocation.<br>
<br>
I'll try memory debug, but don't know, when - our OpenSIPS works under load,<br>
people make calls and so on :) I use version 1.6.0 for now, it seems to be quite<br>
stable.<div><div></div><div class="h5"><br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Alexander,<br>
<br>
</blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Indeed, the stun issue looks like a silly bug - I fixed it on SVN - Thanks a lot for the report and fix.<br>
<br>
</blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Regarding the other bugs you reported, could you please compile in the memory debug support (<a href="http://www.opensips.org/Resources/DocsTsMem" target="_blank">http://www.opensips.org/Resources/DocsTsMem</a>) and set<br>
memlog=8<br>
memdump=2<br>
<br>
</blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
maybe the debugger will be able to get out more info.<br>
<br>
</blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Regards,<br>
Bogdan<br>
<br>
</blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alexander wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've encountered a problem - sometimes OpenSIPS 1.6.0 crashes. GDB says that crash was in stun.c, line 836. Going to this line, we see:<br>
<br>
case UNKNOWN_ATTRIBUTES:<br>
/* iterator */<br>
b2 = (T16 *) msg->unknownAttributes->buffer;<br>
/* allocate unknownAttributes buffer */<br>
msg->unknownAttributes = (Buffer*) pkg_malloc(sizeof(Buffer));<br>
if(!msg->unknownAttributes){<br>
LM_DBG("out of mem\n");<br>
return -1;<br>
}<br>
memset(msg->unknownAttributes, 0, sizeof(Buffer));<br>
<br>
Is it OK, that we create iterator, and then allocate buffer? uknownAttributes is not allocated when iterator is created. I've changed it to:<br>
<br>
case UNKNOWN_ATTRIBUTES:<br>
/* allocate unknownAttributes buffer */<br>
msg->unknownAttributes = (Buffer*) pkg_malloc(sizeof(Buffer));<br>
if(!msg->unknownAttributes){<br>
LM_DBG("out of mem\n");<br>
return -1;<br>
}<br>
memset(msg->unknownAttributes, 0, sizeof(Buffer));<br>
<br>
/* iterator */<br>
b2 = (T16 *) msg->unknownAttributes->buffer;<br>
<br>
Now it seems to work properly.<br>
<br>
By the way, version 1.6.1 contains the same bug in STUN module. Unfortunately, 1.6.1 is unusable for me - crashes too often :( I wrote one report about crash on NOTIFY (with backtrace), and today I've encountered another crash:<br>
<br>
Program terminated with signal 11, Segmentation fault.<br>
[New process 19330]<br>
#0 0x080ec3d9 in fm_malloc (qm=0x81b3c00, size=<value optimized out>) at mem/f_malloc.c:172<br>
172 *pf=n->u.nxt_free;<br>
(gdb) where<br>
#0 0x080ec3d9 in fm_malloc (qm=0x81b3c00, size=<value optimized out>) at mem/f_malloc.c:172<br>
#1 0x00603d04 in build_rr (_l=0x81e07d8, _l2=0x81e1d1c, user=0xbff381d0, tag=0x81d1fc0, params=0x0, _inbound=1) at record.c:163<br>
#2 0x0060471f in record_route (_m=0x81d1bec, params=0x0) at record.c:320<br>
#3 0x00606031 in w_record_route (msg=0x81d1bec, key=0x0, bar=0x0) at rr_mod.c:272<br>
#4 0x080545dd in do_action (a=0x81bdb2c, msg=0x81d1bec) at action.c:967<br>
#5 0x08057308 in run_action_list (a=0x81bdb2c, msg=0x81d1bec) at action.c:139<br>
#6 0x080554dd in do_action (a=0x81bdb98, msg=0x81d1bec) at action.c:706<br>
#7 0x08057308 in run_action_list (a=0x81bd578, msg=0x81d1bec) at action.c:139<br>
#8 0x080576a3 in run_top_route (a=0x81bd578, msg=0x81d1bec) at action.c:119<br>
#9 0x0809ddf2 in receive_msg (<br>
buf=0x8192380 "OPTIONS sip:<a href="http://sip.comtube.ru" target="_blank">sip.comtube.ru</a> <<a href="http://sip.comtube.ru" target="_blank">http://sip.comtube.ru</a>> SIP/2.0\r\nVia: SIP/2.0/UDP 85.21.245.172:5060;branch=z9hG4bK57769584;rport\r\nMax-Forwards: 69\r\nFrom: \"asterisk\" <<a href="mailto:sip%3Aasterisk@85.21.245.172" target="_blank">sip:asterisk@85.21.245.172</a> <mailto:<a href="mailto:sip%253Aasterisk@85.21.245.172" target="_blank">sip%3Aasterisk@85.21.245.172</a>>>;tag=as58d6d6b9\r\nTo: <sip:sip.comtu"..., len=511, rcv_info=0xbff388d4) at receive.c:162<br>
#10 0x080e5056 in udp_rcv_loop () at udp_server.c:492<br>
#11 0x08070adf in main (argc=5, argv=0xbff38ae4) at main.c:821<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<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>
</blockquote></blockquote>
<br>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote><div><div></div><div class="h5">
<br>
<br>
-- <br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
</div></div></blockquote></div><br>