-
Notifications
You must be signed in to change notification settings - Fork 565
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] wolfssl memory leak #2604
Comments
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. |
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. |
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. |
Hi @rvlad-patrascu |
Hi @vasilevalex, Can you please try the following patch? |
Hi @rvlad-patrascu , I've built it. I will write here, when I have some stats. |
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. |
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. |
I'm afraid the patch did not 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. |
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. |
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. |
Hi @vasilevalex Unfortunately I can not identify why the leak is still happening without some additional information from the wolfSSL library. I've prepared a patch which enables memory debugging for wolfSSL so we can see where the allocations happen in the wolfSSL code when doing the shm memory dump. Can you apply the following patch, rebuild wolfSSL and get a couple of mem dumps? |
Hi @rvlad-patrascu |
Hi @vasilevalex, I still cannot determine why the leak happens based on the above dumps but it does give some hints. I've come up with a temporary "fix" that would help narrow this down more, should it prevent the leak. So can you please apply the patch attached here(along with wolfssl_debug_mem.patch.txt, in case the leak persists) and give it another go? |
Hi @rvlad-patrascu , I built version with both patches. It behaviors strange. After start OpenSIPS processes several TLS connections, but then silently stops accepting any TLS traffic. No logs, no errors. UDP is still processed. But impossible to connect to TLS anymore. I made trap file with opensips-cli, if you need it, I can send to email. So I had to roll back. |
Hi @vasilevalex Please send the trap file to vladp@opensips.org. Also, did you see any opensips processes with 100% CPU load? |
Ok, my mistake here, there was indeed an error in the previous patch that would deadlock the TCP main process. It should be fixed now, see the updated patch below. |
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. |
Marking as closed due to lack of progress for more than 30 days. If this issue is still relevant, please re-open it with additional details. |
It's not fixed yet, please reopen. |
Hi @vasilevalex, By not fixed yet, do you mean the deadlock introduced with wolfssl_mem_leak_tmp_fix.patch.txt or the actual memleak? |
Hi @rvlad-patrascu , |
OpenSIPS version you are running
Describe the bug
We have OpenSIPS server, which processes RTCP reports from more than 10000 phones. Reports are coming in SIP PUBLISH over TLS, sometimes with pikes like ~15000 connections per minute. But in general it has over 500 established TLS connections (some are closed, new are opened). After updating to OpenSIPS 3.2.0 with wolfssl shared memory consumption started growing constantly.
I run OpenSIPS with
-a F_MALLOC_DBG
and made several snapshots withmi mem_shm_dump
. Most amount of allocated shared memory is564303792 : 808816 x [wolfssl.c: oss_malloc, line 132]
and significant growth is only on this line. Reports are attached.Then I changed only one line in config
loadmodule "tls_wolfssl.so"
toloadmodule "tls_openssl.so"
This point is also shown on the graph at the end. With OpenSSL shared memory consumption is not growing.To Reproduce
Expected behavior
Don't leak.
OS/environment information
CentOS Linux release 8.4.2105
git
Additional context
Memory dumps during one day:
shmem_dump01.txt
shmem_dump02.txt
shmem_dump03.txt
The text was updated successfully, but these errors were encountered: