Skip to content
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

Add gvl and fiber assertions to scheduler interface to catch invalid usage. #4656

Merged
merged 1 commit into from Sep 20, 2021

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Jul 16, 2021

This is an attempt to diagnose/catch the following error reported by @jeremyevans: https://github.com/ruby/ruby/pull/4616/checks?check_run_id=3078517784#step:15:27

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only makes changes to the fiber scheduler, so it seems fine to me.

@@ -639,6 +639,8 @@ rb_check_funcall(VALUE recv, ID mid, int argc, const VALUE *argv)
static VALUE
rb_check_funcall_default_kw(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE def, int kw_splat)
{
VM_ASSERT(ruby_thread_has_gvl_p());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM_ASSERT is only if VM_CHECK_MODE > 0 so if -DRUBY_DEBUG, so not in regular builds.
Sounds fine to me.

@ioquatix ioquatix self-assigned this Sep 20, 2021
@ioquatix ioquatix merged commit b61064b into ruby:master Sep 20, 2021
@ioquatix ioquatix deleted the scheduler-assertions branch September 20, 2021 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants