[OpenSIPS-Devel] [ opensips-Bugs-3125596 ] mem leak

SourceForge.net noreply at sourceforge.net
Tue Dec 14 17:06:02 CET 2010


Bugs item #3125596, was opened at 2010-12-02 09:39
Message generated for change (Comment added) made by thr1ll3rb33
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3125596&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.6.x
Status: Open
Resolution: Accepted
Priority: 7
Private: No
Submitted By: thrillerbee (thr1ll3rb33)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: mem leak 

Initial Comment:
Errors in the syslog this time right before the crash:
/usr/local/sbin/opensips[27044]: ERROR:db_flatstore:new_flat_id: no pkg memory left
kernel: [5508366.582447] opensips[27044]: segfault at 10 ip 7fa7ff74c21f sp 7fffdc101700 error 4 in db_flatstore.so[7fa7ff749000+5000]

I do use the flat_rotate MI command with the acc module for cdr collection.  The backtrace is attached.

mem dumps are here:
http://www.starviewconnect.com/tmp/core1_mem_dump_20101112.gz
http://www.starviewconnect.com/tmp/core2_mem_dump_20101112.gz

----------------------------------------------------------------------

>Comment By: thrillerbee (thr1ll3rb33)
Date: 2010-12-14 10:06

Message:
Makefile.defs is attached

opensips -V
version: opensips 1.6.3-notls (x86_64/linux)
flags: STATS: Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM,
SHM_MMAP, PKG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
svnrevision: 2:7290M
@(#) $Id: main.c 6169 2009-09-22 12:48:37Z bogdan_iancu $
main.c compiled on 22:47:42 Dec  8 2010 with gcc 4.3.2

Relevant config:
debug=2
memlog=10
memdump=1

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-12-14 08:29

Message:
Your opensips is still not compiled with mem debugging :(...The dump from
memory debugger looks like:
     0(17665) Memory status (shm):
     0(17665) qm_status (0xb5a7e000):
     0(17665)  heap size= 33554432
     0(17665)  used= 1592952, used+overhead=1811564, free=31742868
     0(17665)  max used (+overhead)= 1811564
     0(17665) dumping all alloc'ed. fragments:
     0(17665)       0. N  address=0xb5ab240c frag=0xb5ab23f4 size=4
used=1
     0(17665)             alloc'd from mem/shm_mem.c:
shm_mem_init_mallocs(199)
     0(17665)         start check=f0f0f0f0, end check= c0c0c0c0, abcdefed
     0(17665)       1. N  address=0xb5ab2440 frag=0xb5ab2428 size=4 used=1

     0(17665)             alloc'd from timer.c: init_timer(52)
     0(17665)         start check=f0f0f0f0, end check= c0c0c0c0, abcdefed

Just to check the flags you use, please upload your Makefile.defs and post
the output of "opensips  -V" .

Thanks and regards,
Bogdan

----------------------------------------------------------------------

Comment By: thrillerbee (thr1ll3rb33)
Date: 2010-12-13 08:56

Message:
The requested mem dump can be downloaded here:
http://www.starviewconnect.com/tmp/mem_dump_20101213.zip

Thanks.

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-12-03 06:28

Message:
Hi,

Indeed, the logs show a leak and I suspect it is from db_flatstore module
- unfortunately you do not have properly compiled the memory debugging
support, so it hard to pinpoint the guilty code.
I tried to reproduce ACC via flatstore, but not able to get a leak at
all...

So, please compile the memory debugger as per
http://www.opensips.org/Resources/DocsTsMem  (be sure you put DBG_QM_MALLOC
and take out F_MALLOC ) and recompile + reinstall +  restart opensips.

In your cfg use:
memlog=10
memdump=1
This will generate only a memory dump without any additional memory logs
at rutime.

You can take a mem dump at runtime by sending a SIGUSR1 signal to an
opensips process,
Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3125596&group_id=232389



More information about the Devel mailing list