diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-12-15 08:12:17 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-12-15 08:12:17 +0000 |
commit | d1a33d8ec514e24cbda8c62ab529b3920f0f97f4 (patch) | |
tree | ba5ef8cd5e88f8fd79c55508a2a69d3f96c49559 | |
parent | 70d885617c01ad04c87309edb39a461d371099a0 (diff) | |
download | ruby-d1a33d8ec514e24cbda8c62ab529b3920f0f97f4.tar.gz |
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_6@67834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/openssl/ossl_asn1.c | 2 | ||||
-rw-r--r-- | test/openssl/test_asn1.rb | 5 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index ab45bd833c..0085d4beab 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1824,7 +1824,7 @@ do{\ rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0); class_tag_map = rb_hash_new(); - rb_global_variable(&class_tag_map); + 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.6.6" #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 121 +#define RUBY_PATCHLEVEL 122 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 12 |