[SR-Users] Freeing already Freed pointer

Daniel-Constantin Mierla miconda at gmail.com
Thu Oct 4 09:05:35 CEST 2018


The line is now a comment in 5.1 branch, send the output the command
'list' in gdb.


Are all the backtraces from those core files looking the same?


Can you reproduce the issue?


Can you list here the loaded modules (the lines with loadmodule from
kamailio.cfg)?


Cheers,
Daniel


On 04.10.18 08:48, Hamid Hashmi wrote:
> No, I am not that expert 😊
>
> I just find out that there are so many dump files in the working
> directory.  Please find the backtrace below
>
> #0  0x00007f3e27818c9f in t_should_relay_response
> (Trans=0x7f3de60bdc60, new_code=200, branch=0,
> should_store=0x7fff44501d78, should_relay=0x7fff44501d7c,
> cancel_data=0x7fff44501fc0,
>     reply=0x7f3e2a042708) at t_reply.c:1281
> #1  0x00007f3e2781d1d6 in relay_reply (t=0x7f3de60bdc60,
> p_msg=0x7f3e2a042708, branch=0, msg_status=200,
> cancel_data=0x7fff44501fc0, do_put_on_wait=1) at t_reply.c:1785
> #2  0x00007f3e278223a2 in reply_received (p_msg=0x7f3e2a042708) at
> t_reply.c:2530
> #3  0x00000000004f0271 in do_forward_reply (msg=0x7f3e2a042708,
> mode=0) at core/forward.c:744
> #4  0x00000000004f1a31 in forward_reply (msg=0x7f3e2a042708) at
> core/forward.c:845
> #5  0x0000000000572d17 in receive_msg (
>     buf=0xa533c0 <buf.6822> "SIP/2.0 200 OK\r\nVia: SIP/2.0/UDP
> *X.X.X.X:xxx*;branch=z9hG4bK408d.a486c78251b57e015f4f0942872a10bf.0;i=2;received=*X.X.X.X*\r\nVia:
> SIP/2.0/TCP 192.168.2.7:60336;received=58.65.176.42;rport=26439;b"...,
> len=969, rcv_info=0x7fff44502730) at core/receive.c:355
> #6  0x0000000000454f9c in udp_rcv_loop () at core/udp_server.c:554
> #7  0x0000000000424409 in main_loop () at main.c:1619
> #8  0x000000000042b98e in main (argc=9, argv=0x7fff44502c78) at
> main.c:2638  
>
> Regards
>
>
> *Hamid R. Hashmi*
>
> ------------------------------------------------------------------------
> *From:* Daniel-Constantin Mierla <miconda at gmail.com>
> *Sent:* Thursday, October 4, 2018 11:30 AM
> *To:* Kamailio (SER) - Users Mailing List; Hamid Hashmi
> *Subject:* Re: [SR-Users] Freeing already Freed pointer
>  
>
> Hello,
>
>
> do you have your own developed module or other private extensions made
> to kamailio?
>
>
> The logs show there was a core dump file, locate it and get the back
> trace with gdb and send it here.
>
>
> Cheers,
> Daniel
>
>
> On 03.10.18 10:39, Hamid Hashmi wrote:
>> Dear Kamailio User
>>
>> Can you please guide me in identifying the issue. 
>>
>> Sep 27 14:40:19 kamailio_eu SIPSer[11289]: 923226363266 923000000001
>> 27872 INVITE haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4df30), called from tm: t_reply.c:
>> relay_reply(1920), first free tm: h_table.c: free_cell_helper(155) -
>> aborting Sep 27 14:40:19 kamailio_eu SIPSer[11289]: 923226363266
>> 923000000001 27872 INVITE haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL:
>> <core> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already
>> freed pointer (0x7f30c8a4cc40), called from tm: h_table.c:
>> free_cell_helper(153), first free tm: h_table.c:
>> free_cell_helper(153) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4afc8), called from tm: h_table.c:
>> free_cell_helper(153), first free tm: h_table.c:
>> free_cell_helper(153) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4af38), called from tm: h_table.c:
>> free_cell_helper(174), first free tm: h_table.c:
>> free_cell_helper(174) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4ae38), called from dialog: dlg_handlers.c:
>> dlg_iuid_sfree(305), first free dialog: dlg_handlers.c:
>> dlg_iuid_sfree(305) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4aea8), called from tm: h_table.c:
>> free_cell_helper(174), first free tm: h_table.c:
>> free_cell_helper(174) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4ada8), called from tm: h_table.c:
>> free_cell_helper(174), first free tm: h_table.c:
>> free_cell_helper(174) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4ad18), called from tm: h_table.c:
>> free_cell_helper(174), first free tm: h_table.c:
>> free_cell_helper(174) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4ac88), called from tm: h_table.c:
>> free_cell_helper(174), first free tm: h_table.c:
>> free_cell_helper(174) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4d290), called from tm: h_table.c:
>> free_cell_helper(181), first free tm: h_table.c:
>> free_cell_helper(181) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4ca20), called from tm: h_table.c:
>> free_cell_helper(231), first free tm: h_table.c:
>> free_cell_helper(231) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4c998), called from tm: h_table.c:
>> free_cell_helper(232), first free tm: h_table.c:
>> free_cell_helper(232) - aborting Sep 27 14:40:19 kamailio_eu
>> SIPSer[11289]: 923226363266 923000000001 27872 INVITE
>> haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a495d8), called from tm: h_table.c:
>> free_cell_helper(251), first free tm: h_table.c:
>> free_cell_helper(251) - aborting
>>
>> Regards
>>
>>
>> *Hamid R. Hashmi*
>>
>> ------------------------------------------------------------------------
>> *From:* sr-users <sr-users-bounces at lists.kamailio.org>
>> <mailto:sr-users-bounces at lists.kamailio.org> on behalf of Hamid
>> Hashmi <hamid2kviii at hotmail.com> <mailto:hamid2kviii at hotmail.com>
>> *Sent:* Thursday, September 27, 2018 5:14 PM
>> *To:* Kamailio (SER) - Users Mailing List
>> *Subject:* [SR-Users] Freeing already Freed pointer
>>  
>> I have been receiving CRITICAL core logs since I have updated my
>> service to the following version. 
>>
>> Print out of kamailio internals
>>   Version: kamailio 5.1.5 (x86_64/linux) d06080
>>   Default config: /usr/local/SIPSer/etc/kamailio/kamailio.cfg
>>   Default paths to modules: /usr/local/SIPSer/lib64/kamailio/modules
>>   Compile flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
>> USE_RAW_SOCKS, 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
>>   MAX_RECV_BUFFER_SIZE=262144
>>   MAX_URI_SIZE=1024
>>   BUF_SIZE=65535
>>   DEFAULT PKG_SIZE=8MB
>>   DEFAULT SHM_SIZE=64MB
>>   ADAPTIVE_WAIT_LOOPS=1024
>>   TCP poll methods: poll, epoll_lt, epoll_et, sigio_rt, select
>>   Source code revision ID: d06080
>>   Compiled with: gcc 4.8.5
>>   Compiled on: 14:17:56 Sep 13 2018
>> Thank you for flying kamailio!
>>
>> I have been starting kamailio with the following command
>>
>> $ /usr/local/sbin/kamailio -P /run/kamailio/kamailio.pid -f
>> /usr/local/etc/kamailio/kamailio.cfg -m 1024 -M 512
>>
>> Sample Critical Logs are below
>>
>> Sep 27 14:40:19 kamailio_eu SIPSer[11289]: 923226363266 923000000001
>> 27872 INVITE haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4df30), called from tm: t_reply.c:
>> relay_reply(1920), first free tm: h_table.c: free_cell_helper(155) -
>> aborting
>> Sep 27 14:40:19 kamailio_eu SIPSer[11289]: 923226363266 923000000001
>> 27872 INVITE haYKxpYM1QR8XTU37WdVbxf4VkEITe7A CRITICAL: <core>
>> [core/mem/q_malloc.c:504]: qm_free(): BUG: freeing already freed
>> pointer (0x7f30c8a4cc40), called from tm: h_table.c:
>> free_cell_helper(153), first free tm: h_table.c:
>> free_cell_helper(153) - aborting
>>
>> Its also causing service crash.  Complete logs are here
>> <https://paste.ee/p/q65DE>. 
>>
>> Regards
>>
>> *Hamid R. Hashmi*
>>
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
> www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
> Kamailio World Conference -- www.kamailioworld.com <http://www.kamailioworld.com>
> Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com <http://www.asipto.com>
>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference -- www.kamailioworld.com
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20181004/ded5984b/attachment.html>


More information about the sr-users mailing list