[pull] master from ruby:master#1012
Merged
Merged
Conversation
rb_gc_initialize_vm_context calls GET_EC, which does VM_ASSERT(ec != NULL). When Ruby is built with RUBY_DEBUG=1 and GC stress is set to run at boot with RUBY_DEBUG=gc_stress then GC gets run inside Init_BareVM when we're setting up the main_thread. In gc_start we gate the GC with some early returns that prevent us actually attempting a GC if the heap and objspace are not ready yet, but we're attempting to initialize the gc's VM context before those gates, causing the assertion to fail (because the VM isn't ready yet). This commit moves the vm_context setup after the gates, so we don't attempt it before objspace and the heap are fully set up. To repro this bug configure with --enable-dev-env and cflags=-DRUBY_DEBUG and then run RUBY_DEBUG=gc_stress ./ruby -v
The GC RUBY_DEBUG=gc_stress bug should have been caught by test_gc_stress_at_startup, but because RUBY_DEBUG has been ignored on CI, the subprocess wasn't actually running stress at startup
``` ../test/ruby/test_class.rb:445: warning: already initialized constant TestClass::CloneTest1::TEST ../test/ruby/test_class.rb:438: warning: previous definition of TEST was here ../test/ruby/test_class.rb:448: warning: already initialized constant TestClass::CloneTest2::TEST ../test/ruby/test_class.rb:438: warning: previous definition of TEST was here ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )