summaryrefslogtreecommitdiff
path: root/test/objspace
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-03-31 17:39:40 +0900
committerKoichi Sasada <ko1@atdot.net>2021-03-31 19:18:32 +0900
commit1fac99afdae2671a9ca86bead5bde4d0e2eff1b4 (patch)
tree79a9d4ed4ce36b285c410083515e33464ba66fe6 /test/objspace
parent8b2f2a707de54ad24d787ff0bce67ed8c68cdded (diff)
skip marking for uninitialized imemo_env.
RUBY_INTERNAL_EVENT_NEWOBJ can expose uninitialized imemo_env objects and marking it will cause critical error. This patch skips marking on uninitialized imemo_env. See: http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20210329T183003Z.fail.html.gz Shortest repro-code is provided by mame-san.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4342
Diffstat (limited to 'test/objspace')
-rw-r--r--test/objspace/test_objspace.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 841a1e7c2a..1ccee02faa 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -243,6 +243,19 @@ class TestObjSpace < Test::Unit::TestCase
GC.enable
end
+ def test_trace_object_allocations_gc_stress
+ prev = GC.stress
+ GC.stress = true
+
+ ObjectSpace.trace_object_allocations{
+ proc{}
+ }
+
+ assert true # success
+ ensure
+ GC.stress = prev
+ end
+
def test_dump_flags
info = ObjectSpace.dump("foo".freeze)
assert_match(/"wb_protected":true, "old":true/, info)