-
Notifications
You must be signed in to change notification settings - Fork 586
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
[BUG] Memory leak in TLS connection ERROR when HEP is enabled for TLS #3496
Comments
@zooptwopointone , please see here some info on how to deal with OOM issues - https://opensips.org/Documentation/TroubleShooting-OutOfMem. Try to get a pkg mem dump from the proc reporting the pkg OOM. |
Here is the output of a server configured with 4MB of pkg memory after it started to have the problem. Followed the link you provided and this is the result of running the opensips-cli .... command. |
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days. |
This is still an issue. |
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days. |
No updates from me, just waiting to see if there is more information I can provide. |
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days. |
This is still an issue. |
Adding comment to not let it go stale. |
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days. |
Adding comment to not get stale again. |
@bogdan-iancu Sorry maybe I needed to tag you. the log you requested is attached above. |
@zooptwopointone , thanks for the heads up here. Yes, I see in the mem dump the 3733 hep chunks, still allocated. The question is (or more looking for confirmation) : this leak happens only when there is a TLS failure? if so, can you detail on the failure ? |
@bogdan-iancu Yes this Only happens with TLS and HEP. I am not sure how to explain the failure further, besides that you get memory allocation issues causing new valid connections to fail. And If I remember right it would be any SIP Communication UDP/TCP/TLS at that point as non of them can Allocate memory. From looking at the code. (Me being only Hacker level in C) is that the Normal TCP part of the connection can get established then it will do HEP. So if there is a failure with the TCP connection the HEP memory allocation never happens., But what I remember seeing for TLS is that once the TCP connection is Established it will allocate the HEP memroy then Negotiate TLS. and if that fails it didn't seem to have a place where it would Free() the memory for HEP on failure. Again I am not great at C and it has been quite a while ago since I was looking at it. Let me know how else I can help. |
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days. |
OpenSIPS version you are running
Describe the bug
There appears to be a Memory leak in PKG memory for TLS connections when HEP is enabled for TLS.
To Reproduce
Using Wolf SSL
Running this in a loop, which connects sends nothing over and closes the connection. So that TLS fails.
Will result in this error message, which also starts to cause problems with real calls.
Commenting out
and doing the same test never results in failure. I used -m 64 -M 2 options to test on a system not taking any calls just to narrow down the problem. I tried looking into the code to see if I could spot where it was missing when a TLS connection fails, but it is a bit more involved than I can spend right now.
Expected behavior
TLS connection failures should cleanup memory used by HEP(speculation) just like successful connection end.
Relevant System Logs
Provided above.
OS/environment information
Debian 12
Opensips installed from Opensips package installation process provided by Opensips.org
Additional context
The TLS errors are high on our network as there is a LoadBalancer that makes a TCP connection to the port to validate reachability. It is currently not capable of negotiating TLS. This was not a problem for 2.4 version of Opensips.
The text was updated successfully, but these errors were encountered: