<div dir="auto"><div>Hey,</div><div dir="auto"><br></div><div dir="auto">looks like an error with memory allocation. If you haven't done yet, it would be nice if you could create an issue on GitHub. Do you still have the coredump? If so please create an trace with gdb and attache it to the issue.</div><div dir="auto"><br></div><div dir="auto">Greetings Rick<br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">Am 16.01.2018 09:50 schrieb "Tsvetan Filev" <<a href="mailto:tsvetan.filev@inno-networks.com">tsvetan.filev@inno-networks.com</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<br>
I get a coredump which is caused by bad memory handling during the diameter capability exchange process.<br>
Here is part of the log file:<br>
==============================<wbr>=====<br>
2018-01-16T09:16:39.890992+02:<wbr>00 linux-o12d kamailio[13298]: 87(13388) INFO: cdp [worker.c:332]: worker_process(): [0] Worker process started...<br>
2018-01-16T09:16:40.296393+02:<wbr>00 linux-o12d systemd-coredump[13196]: Process 13193 (kamailio) of user 479 dumped core.<br>
2018-01-16T09:16:40.871483+02:<wbr>00 linux-o12d kamailio[13298]: 94(13395) DEBUG: cdp [peermanager.c:263]: peer_timer(): peer_timer(): taking care of peers...<br>
2018-01-16T09:16:40.871545+02:<wbr>00 linux-o12d kamailio[13298]: 94(13395) DEBUG: cdp [peermanager.c:280]: peer_timer(): peer_timer(): Peer <a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnetw<wbr>ork.org</a> State 0<br>
2018-01-16T09:16:40.871596+02:<wbr>00 linux-o12d kamailio[13298]: 94(13395) DEBUG: cdp [peerstatemachine.c:90]: sm_process(): sm_process(): Peer <a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnetw<wbr>ork.org</a> State Closed Event Start<br>
2018-01-16T09:16:40.871612+02:<wbr>00 linux-o12d kamailio[13298]: 94(13395) INFO: cdp [peerstatemachine.c:525]: I_Snd_Conn_Req(): I_Snd_Conn_Req(): Peer <a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnetw<wbr>ork.org</a><br>
2018-01-16T09:16:40.871636+02:<wbr>00 linux-o12d kamailio[13298]: 94(13395) INFO: cdp [receiver.c:869]: peer_connect(): peer_connect(): Trying to connect to 10.82.10.85 port 3868<br>
2018-01-16T09:16:40.871782+02:<wbr>00 linux-o12d kamailio[13298]: 94(13395) INFO: cdp [receiver.c:937]: peer_connect(): peer_connect(): Peer <a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org:3868" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnetw<wbr>ork.org:3868</a> connected<br>
2018-01-16T09:16:40.871813+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [receiver.c:697]: receive_loop(): select_recv(): There is something on the fd exchange pipe<br>
2018-01-16T09:16:40.871828+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [receiver.c:706]: receive_loop(): select_recv(): fd exchange pipe says fd [22] for peer 0x7f0626b91c98:[<a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019<wbr>.mcc425.3gppnetwork.org</a>]<br>
2018-01-16T09:16:40.871910+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:90]: sm_process(): sm_process(): Peer <a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnetw<wbr>ork.org</a> State Wait_Conn_Ack Event I_Rcv_Conn_Ack<br>
2018-01-16T09:16:40.871933+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [diameter_msg.c:184]: AAANewMessage(): AAANewMessage: param session received null and it's a request!!<br>
2018-01-16T09:16:40.872011+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [diameter_msg.c:81]: AAABuildMsgBuffer(): AAABuildMsgBuffer(): len=204<br>
2018-01-16T09:16:40.872041+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [receiver.c:994]: peer_send_msg(): peer_send_msg(): Pipe push [0x7f0626c02548]<br>
2018-01-16T09:16:40.872064+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [receiver.c:751]: receive_loop(): select_recv(): There is something on the send pipe<br>
2018-01-16T09:16:40.872084+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [receiver.c:764]: receive_loop(): select_recv(): Send pipe says [0x7f0626c02548] 8<br>
2018-01-16T09:16:40.872104+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [diameter_msg.c:410]: AAAFreeMessage(): AAAFreeMessage: Freeing message (0x7f0626c02548) 257<br>
2018-01-16T09:16:40.872277+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [receiver.c:574]: do_receive(): receive_loop(): [<a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnet<wbr>work.org</a>] Recv Version 1 Length 360<br>
2018-01-16T09:16:40.872322+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [receiver.c:1088]: receive_message(): receive_message(): [<a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnet<wbr>work.org</a>] Recv msg 257<br>
2018-01-16T09:16:40.872345+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:90]: sm_process(): sm_process(): Peer <a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3gppnetw<wbr>ork.org</a> State Wait_I_CEA Event I_Rcv_CEA<br>
2018-01-16T09:16:40.872372+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:692]: count_Supported_Vendor_Id_AVPS<wbr>(): Found 4 Supported_Vendor AVPS92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 5535<br>
2018-01-16T09:16:40.872389+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 10415<br>
2018-01-16T09:16:40.872405+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 13019<br>
2018-01-16T09:16:40.872420+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 58637<br>
2018-01-16T09:16:40.872438+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 5535<br>
2018-01-16T09:16:40.872453+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 10415<br>
2018-01-16T09:16:40.872468+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 13019<br>
2018-01-16T09:16:40.872486+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 58637<br>
2018-01-16T09:16:40.872504+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 5535<br>
2018-01-16T09:16:40.872523+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 10415<br>
2018-01-16T09:16:40.872539+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 13019<br>
2018-01-16T09:16:40.872554+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:743]: save_peer_applications(): Found Supported Vendor for Application 0: 58637<br>
2018-01-16T09:16:40.872570+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:756]: save_peer_applications(): Found Supported Vendor for Application 1: 5535<br>
2018-01-16T09:16:40.872586+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:756]: save_peer_applications(): Found Supported Vendor for Application 1: 10415<br>
2018-01-16T09:16:40.872601+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:756]: save_peer_applications(): Found Supported Vendor for Application 1: 13019<br>
2018-01-16T09:16:40.872616+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) DEBUG: cdp [peerstatemachine.c:756]: save_peer_applications(): Found Supported Vendor for Application 1: 58637<br>
2018-01-16T09:16:40.872634+02:<wbr>00 linux-o12d kamailio[13298]: 92(13393) CRITICAL: <core> [core/mem/q_malloc.c:145]: qm_debug_frag(): BUG: qm: prev. fragm. tail overwritten(28af01000000, 0)[0x7f0626c038d0:0x7f0626c039<wbr>08]! Memory allocator was called from cdp: diameter_avp.c:365. Fragment marked by cdp: diameter_avp.c:142.<br>
2018-01-16T09:16:41.054292+02:<wbr>00 linux-o12d kamailio[13298]: 0(13298) ALERT: <core> [main.c:746]: handle_sigs(): child process 13393 exited by a signal 6<br>
2018-01-16T09:16:41.054403+02:<wbr>00 linux-o12d kamailio[13298]: 0(13298) ALERT: <core> [main.c:749]: handle_sigs(): core was generated<br>
2018-01-16T09:16:41.054422+02:<wbr>00 linux-o12d kamailio[13298]: 0(13298) INFO: <core> [main.c:771]: handle_sigs(): terminating due to SIGCHLD<br>
2018-01-16T09:16:41.054438+02:<wbr>00 linux-o12d kamailio[13298]: 0(13298) DEBUG: <core> [main.c:773]: handle_sigs(): terminating due to SIGCHLD<br>
2018-01-16T09:16:41.054464+02:<wbr>00 linux-o12d kamailio[13298]: 2(13303) INFO: <core> [main.c:826]: sig_usr(): signal 15 received<br>
...<br>
==============================<wbr>=====<br>
<br>
Attached is wireshark trace.<br>
Here is my DiameterPeer.xml:<br>
<br>
==============================<wbr>=====<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<DiameterPeer<br>
FQDN="<a href="http://ims110-scscf.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">ims110-scscf.epc.mnc019.<wbr>mcc425.3gppnetwork.org</a>"<br>
Realm="<a href="http://epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">epc.mnc019.mcc425.3gppn<wbr>etwork.org</a>"<br>
Vendor_Id="10415"<br>
Product_Name="CDiameterPeer"<br>
AcceptUnknownPeers="1"<br>
DropUnknownOnDisconnect="1"<br>
Tc="30"<br>
Workers="4"<br>
QueueLength="8"<br>
TransactionTimeout="5"<br>
SessionsHashSize="128"<br>
DefaultAuthSessionTimeout="360<wbr>0"<br>
MaxAuthSessionTimeout="3600"><br>
<br>
<Peer FQDN="<a href="http://hss.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">hss.epc.mnc019.mcc425.3g<wbr>ppnetwork.org</a>" Realm="<a href="http://epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">epc.mnc019.mcc425.3gppn<wbr>etwork.org</a>" port="3868" /><br>
<Acceptor port="3869" bind="10.82.10.56" /><br>
<Auth id="16777216" vendor="10415" /> <!--3GPP CxDX --><br>
<DefaultRoute FQDN="<a href="http://ims110-scscf.epc.mnc019.mcc425.3gppnetwork.org" rel="noreferrer" target="_blank">ims110-scscf.epc.mnc019.<wbr>mcc425.3gppnetwork.org</a>" metric="10" /><br>
</DiameterPeer><br>
==============================<wbr>=====<br>
<br>
It looks like buffer overflow to me but I'm not sure.<br>
<br>
kamailio version is:<br>
==============================<wbr>=====<br>
kamailio -v<br>
version: kamailio 5.1.0 (x86_64/linux)<br>
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES<br>
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled on 05:30:36 Jan 15 2018 with gcc 4.8.5<br>
==============================<wbr>=====<br>
<br>
OS is openSUSE Leap 42.3.<br>
Kernel: Linux linux-o12d 4.4.104-39-default #1 SMP Thu Jan 4 08:11:03 UTC 2018 (7db1912) x86_64 x86_64 x86_64 GNU/Linux<br>
<br>
Do you have any idea what might be wrong ?<br>
It could be bad config but still it should say something in the log without a crash.<br>
<br>
Regards.<br>
<br>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div></div></div>