diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2020-03-30 21:37:50 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2020-03-30 21:37:50 +0000 |
commit | ac6dd2fecca31cdb6a06cf89eded6c9003ae8af5 (patch) | |
tree | 9d85d35ddbc647e2006414bdbf4023bfe40ec66e | |
parent | bc7d6e66ce11cf8d02c72a1df2f7c47d238936b6 (diff) |
merge revision(s) 203b7fa1ae8cc40d41c38d684f70b3fea7fae813,0131fab749fb76800de09e49a6abf910201c5b58,9c0cd5c569ba22bc68d1a77ad6580a275cd99639,c144d7215b3444fa36d28d540b60170a5b30743d: [Backport #16196]
Guard static variable first
* ext/openssl/ossl_asn1.c (Init_ossl_asn1): register the static
variable to grab an internal object, before creating the object.
otherwise the just-created object could get collected during the
global variable list allocation. [Bug #16196]
Slimed down test runtime by stressing openssl.so only [Bug #16196]
Prefer rb_gc_register_mark_object
* ext/openssl/ossl_asn1.c (Init_ossl_asn1): prefer
`rb_gc_register_mark_object`, which is better for constant
objects, over `rb_gc_register_address` for global/static
variables which can be re-assigned at runtime. [Bug #16196]
Skip very time consuming test [Bug #16196]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/openssl/ossl_asn1.c | 1 | ||||
-rw-r--r-- | test/openssl/test_asn1.rb | 5 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index 7b6c973803..3c048ab926 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1824,6 +1824,7 @@ do{\ rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0); class_tag_map = rb_hash_new(); + rb_gc_register_mark_object(class_tag_map); rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC)); rb_hash_aset(class_tag_map, cASN1Boolean, INT2NUM(V_ASN1_BOOLEAN)); rb_hash_aset(class_tag_map, cASN1Integer, INT2NUM(V_ASN1_INTEGER)); diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 1170703775..cc11301804 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/test_asn1.rb @@ -635,6 +635,11 @@ class OpenSSL::TestASN1 < OpenSSL::TestCase assert_equal data, seq.entries end + def test_gc_stress + skip "very time consuming test" + assert_ruby_status(['--disable-gems', '-eGC.stress=true', '-erequire "openssl.so"']) + end + private def B(ary) @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.5.8" #define RUBY_RELEASE_DATE "2020-03-31" -#define RUBY_PATCHLEVEL 212 +#define RUBY_PATCHLEVEL 213 #define RUBY_RELEASE_YEAR 2020 #define RUBY_RELEASE_MONTH 3 |