New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak after SIP message fails to be sent due to no socket found #1554
Comments
- part of t_uac_prepare(), reported by GH #1554
Thanks for the report and guidelines to reproduce it. I pushed a patch for it in master branch. Can you try it? If all ok, then I will backport. Was this case how you discovered it? Or was another scenario? I want to see if we should look at other parts of code. |
Hi Daniel, |
Hi Daniel, |
OK, thanks for testing, it was backported to 5.1 and it will be to 5.0. |
Description
When SIP message fails to be sent due to no socket found, apparently the TM module is not deleting the transaction and so it is causing a memory leak.
Troubleshooting
Reproduction
The easiest way to reproduce the problem is to setup a dispatcher destination with SIP ping enabled. Kamailio should not be listening to the interface which is used to reach that destination. So this will cause Kamailio to complain about not finding a socket to send the OPTIONS.
After this happens, it is possible to see from the kamcmd tm.stats command that the "created" has increased by 1, freed has not changed and "delayed_free" also increased by 1.
Problem is that the delayed_free never gets freed and after checking the kamcmd core.shmmem, for every failed OPTIONS request under this condition, 5808 bits are leaked...
This goes on until there is no shared memory left.....
Debugging Data
Log Messages
Real IPs were replaced, this is their usage:
10.11.12.13 = Kamailio listening IP in local network interface
12.34.56.78 = destination SIP trunk which does not have a matching listened socket by Kamailio
55.66.77.88 = Kamailio listening IP in public network interface
SIP Traffic
Possible Solutions
Additional Information
kamailio -v
The text was updated successfully, but these errors were encountered: