Fix a PHP memory leak with SSL root certificates#12706
Fix a PHP memory leak with SSL root certificates#12706ZhouyihaiDing merged 1 commit intogrpc:masterfrom
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. |
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.peminto memory, narrowed this down togrpc_ssl_roots_override_resultandPHP_METHOD(ChannelCredentials, setDefaultRootsPem)mallocingdefault_pem_root_certswithout freeing, so replaced this withgrp_reallocand 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