[Kamailio-Users] perl module, "pv_sprintf: Memory exhausted!"

Christian Koch chri.koch.vier at googlemail.com
Wed May 20 17:52:09 CEST 2009


Hello Daniel, hello Henning,

Daniel-Constantin Mierla schrieb:
>> The error message in pv_sprintf() occurs when pkg_malloc() returns 
>> NULL, so this should be a PKG issue?!?
>> Currently we're running a test with 0.5MB of pkg memory, but we've 
>> fixed the error in pv_sprintf where the format is wrong and the 
>> buffer is not freed. In the test this morning (with 0.5MB) we had the 
>> message "wrong format" only once, and in all the other tests the 
>> message didn't show up. So we don't think this fixes the problem.
>> Do you think only one missing pkg_free() (like in the last test) can 
>> corrupt the memory so this error occurs?
>>   
>  We changed PKG_MEM_POOL_SIZE from 4 to 8MB and a stress test didn't 
> show any problems for more then 12 hours. Then we changed it to 0.5MB 
> and the problem occured after about 3 hours again wiht the same error 
> message.
> Now that the issue is pkg, you can compile and run in mem debug mode 
> so we can detect easier where the leak is, check this:
> http://www.kamailio.org/dokuwiki/doku.php/troubleshooting:memory
>

After solving all the performance issues with syslog we now made a 
stress test with memdebug enabled. Now kamailio terminates itself 
(perhaps because memory is corrupted?).

May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27684]: 
CRITICAL:core:qm_free: bad pointer (nil) (out of memory block!) - aborting
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27697]: 
CRITICAL:core:receive_fd: EOF on 12
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27679]: 
INFO:core:handle_sigs: child process 27684 exited by a signal 6
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27679]: 
INFO:core:handle_sigs: core was not generated
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27679]: 
INFO:core:handle_sigs: terminating due to SIGCHLD
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27681]: 
INFO:core:sig_usr: signal 15 received
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27681]: Memory 
status (pkg):
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27681]: qm_status 
(0x81677e0):
May 20 15:31:55 AmbriaSip1 /usr/local/sbin/kamailio[27681]:  heap size= 
1048576

The complete output of the memory status is available here:
https://rcpt.yousendit.com/690295962/7b39d332264f086b1bf0f134c026fad3

It would be really great if you could have a look at the logfile! 
Perhaps you have any ideas what could cause this problem, so we can fix it.
If needed, the complete logfile (from startup to termination) is also 
available:
https://rcpt.yousendit.com/690307202/14929008dc7a452d69abb3cbc0a9b58a

Thanks a lot for your support,
Christian




More information about the Users mailing list