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
Fix a PHP memory leak with SSL root certificates #12706
Conversation
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
14 similar comments
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Ok to test |
Does this need a mutex around it? Not entirely sure if this is correct but potentially multiple PHP requests can be setting the default credentials at any point. Before it wouldn't be an issue since the memory would just leak and still be valid but now that it is being re'alloced it could cause problems? |
@jackwakefield Your patch solve ours memory leaks problems. I think this patch must be included on the main tree. Thanks you very much. |
Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement. After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.
Regards, |
Signed. |
7aec7d4
to
fc8eafe
Compare
Thank you for helping us find it. |
I first picked it up in |
Jenkins, test this please |
Sorry for the delay. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I've been running into an issue with requests to PHP-FPM increasing memory by ~100MB which doesn't get freed.
I ran strace on PHP-FPM and noticed many calls to map
vendor/grpc/grpc/etc/roots.pem
into memory, narrowed this down togrpc_ssl_roots_override_result
andPHP_METHOD(ChannelCredentials, setDefaultRootsPem)
mallocingdefault_pem_root_certs
without freeing, so replaced this withgrp_realloc
and made sure to make a copy of the value ingrpc_ssl_roots_override_result
.I based this on the C# extension
grpc/src/csharp/ext/grpc_csharp_ext.c
Line 901 in 8399f92
This appears to be related to #11632