New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ENV
ractor-safe (continue)
#5263
Merged
Merged
Conversation
This file contains 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
Closed
* --braces-after-func-def-line * --space-after-for
We found that we need to make Ruby objects while locking the environ to ENV operation atomically, so we decided to use `RB_VM_LOCK_ENTER()` instead of `env_lock`.
`ENV[key] = long_str` can raise `Errno::EINVAL` also on ucrt env.
👋 our ruby-head CI started crashing last night, I reduced it to: ruby -e 'ENV.instance_exec { @test = 1 }'
Assertion Failed: vm_insnhelper.c:1257:vm_setivar:!rb_ractor_shareable_p(obj)
-- C level backtrace information -------------------------------------------
/usr/local/ruby/bin/ruby(rb_print_backtrace+0x11) [0x556f8d1eb1e8] vm_dump.c:759
/usr/local/ruby/bin/ruby(rb_vm_bugreport) vm_dump.c:1045
/usr/local/ruby/bin/ruby(rb_assert_failure+0x77) [0x556f8cfff4ff] error.c:885
/usr/local/ruby/bin/ruby(vm_method_cfunc_is+0x0) [0x556f8d00af44] vm_insnhelper.c:1257
/usr/local/ruby/bin/ruby(vm_setivar) (null):0
/usr/local/ruby/bin/ruby(vm_get_special_object+0x0) [0x556f8d00da7e] vm.inc:4448
/usr/local/ruby/bin/ruby(vm_exec_core) insns.def:358
/usr/local/ruby/bin/ruby(rb_vm_exec+0xbc) [0x556f8d1cbe2c] vm.c:2218
/usr/local/ruby/bin/ruby(vm_call_bmethod+0x144) [0x556f8d1dd064] vm_insnhelper.c:3106
/usr/local/ruby/bin/ruby(vm_call_method_each_type+0x1ed) [0x556f8d1dd2cd] vm_insnhelper.c:3675
/usr/local/ruby/bin/ruby(vm_call_method+0x10f) [0x556f8d1ddb4f] vm_insnhelper.c:3754
/usr/local/ruby/bin/ruby(vm_call_symbol+0x15d) [0x556f8d1de27d] vm_insnhelper.c:3267
/usr/local/ruby/bin/ruby(vm_call_method_each_type+0x2cc) [0x556f8d1dd3ac] vm_insnhelper.c:3682
/usr/local/ruby/bin/ruby(vm_call_method+0x10f) [0x556f8d1ddb4f] vm_insnhelper.c:3754
/usr/local/ruby/bin/ruby(vm_sendish+0x4b) [0x556f8d1d3fdb] vm_insnhelper.c:4755
/usr/local/ruby/bin/ruby(vm_exec_core) insns.def:778
/usr/local/ruby/bin/ruby(rb_vm_exec+0xbc) [0x556f8d1cbe2c] vm.c:2218
/usr/local/ruby/bin/ruby(catch_i+0x240) [0x556f8d1e03b0] vm.c:1314
/usr/local/ruby/bin/ruby(vm_catch_protect+0x107) [0x556f8d1cad77] vm_eval.c:2379
/usr/local/ruby/bin/ruby(rb_catch_obj+0x28) [0x556f8d1cb00d] vm_eval.c:2405
/usr/local/ruby/bin/ruby(rb_f_catch) vm_eval.c:2355
/usr/local/ruby/bin/ruby(vm_call_cfunc_with_frame+0x110) [0x556f8d1c99d0] vm_insnhelper.c:3041
/usr/local/ruby/bin/ruby(vm_call_method_each_type+0x7d) [0x556f8d1dd15d] vm_insnhelper.c:3643
/usr/local/ruby/bin/ruby(vm_call_method+0x10f) [0x556f8d1ddb4f] vm_insnhelper.c:3754
/usr/local/ruby/bin/ruby(vm_sendish+0x106) [0x556f8d1d4162] vm_insnhelper.c:4755
/usr/local/ruby/bin/ruby(vm_exec_core) insns.def:759
/usr/local/ruby/bin/ruby(rb_vm_exec+0xbc) [0x556f8d1cbe2c] vm.c:2218
/usr/local/ruby/bin/ruby(rb_vm_invoke_proc+0x6f) [0x556f8d1cd3df] vm.c:1519
/usr/local/ruby/bin/ruby(rb_proc_call_kw+0xad) [0x556f8d0e31cd] proc.c:991
/usr/local/ruby/bin/ruby(exec_end_procs_chain+0x44) [0x556f8d02641d] eval_jump.c:105
/usr/local/ruby/bin/ruby(rb_ec_exec_end_proc) eval_jump.c:120
/usr/local/ruby/bin/ruby(rb_ec_teardown+0xdd) [0x556f8d02661d] eval.c:155
/usr/local/ruby/bin/ruby(rb_ec_cleanup+0x176) [0x556f8d026856] eval.c:205
/usr/local/ruby/bin/ruby(ruby_run_node+0x62) [0x556f8d027272] eval.c:321
/usr/local/ruby/bin/ruby(main+0x73) [0x556f8d018bc3] ./main.c:47 |
ko1
added a commit
to ko1/ruby
that referenced
this pull request
Dec 17, 2021
The `ENV` object can have instance variables like other objects, but they should be accessed only on the main ractor. fix ruby#5263 (comment)
ko1
added a commit
to ko1/ruby
that referenced
this pull request
Dec 17, 2021
The `ENV` object can have instance variables like other objects, but they should be accessed only on the main ractor. fix ruby#5263 (comment)
ko1
added a commit
that referenced
this pull request
Dec 17, 2021
The `ENV` object can have instance variables like other objects, but they should be accessed only on the main ractor. fix #5263 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is successor of #4636