-
Notifications
You must be signed in to change notification settings - Fork 451
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
TlsRandomNumberGenerator() can cause memory leaks #2660
Labels
bug
Something isn't working
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Comments
I'm new here, I will open pull requests soon. |
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 7, 2024
3 tasks
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 7, 2024
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 7, 2024
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 7, 2024
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 8, 2024
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 8, 2024
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 8, 2024
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 8, 2024
hongweipeng
added a commit
to hongweipeng/opentelemetry-cpp
that referenced
this issue
May 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
In my program, I found that the memory would continue to increase under multi-threading, and I suspected a memory leak.
In order to verify this problem, I clone this repository and wrote a
gtest
test case:I wrote it in
sdk/test/common/random_test.cc
, compiled it to generaterandom_test
, and used./random_test
to run it. Then I used thetop
command to observe that its memory usage will continue to increase.The reason for this problem is that there is
in the code. When a new thread is created, a new
TlsRandomNumberGenerator()
instance will be created, and the constructor of this class will execute::pthread_atfork(prepare , parent, child);
Memory continues to increase due to multiple executions ofpthread_atfork
.I tried to delete
platform::AtFork
in theTlsRandomNumberGenerator()
constructor function, and the memory usage was normal and would not increase.The text was updated successfully, but these errors were encountered: