From: nagachika00@... Date: 2015-11-18T15:38:23+00:00 Subject: [ruby-core:71556] [Ruby trunk - Bug #10735] Memory leak in openssl ossl_pkey_sign Issue #10735 has been updated by Tomoyuki Chikanaga. Backport changed from 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE Backported into `ruby_2_2` branch at r52651. ---------------------------------------- Bug #10735: Memory leak in openssl ossl_pkey_sign https://bugs.ruby-lang.org/issues/10735#change-54939 * Author: Viktor Vasilev * Status: Closed * Priority: Normal * Assignee: openssl * ruby -v: ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux] * Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE ---------------------------------------- Similar to the memory leak fixed in https://bugs.ruby-lang.org/issues/9743 there is an issue with ossl_pkey_sign. The ruby heap usage reported through GC.stat remains very stable, while the process heap grows linearly with the number of OpenSSL::PKey::RSA sign calls. The documentation at https://www.openssl.org/docs/crypto/EVP_SignInit.html (similar to EVP_VerifyInit) mentions that not disposing the context causes a leak. To reproduce: https://gist.github.com/viktorium/f032cdc8906f43dac94e A patch with a fix very similar to issue #9743: https://gist.github.com/viktorium/b466b72c83d2ab90182c -- https://bugs.ruby-lang.org/