Project

General

Profile

Actions

Bug #20019

closed

Ruby 3.3 GVL instrumentation events are fired out of order

Added by jpcamara (JP Camara) 12 months ago. Updated 11 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-11-23T14:39:30Z fix-thread-instrum.. 285a41d793) +MN [aarch64-linux]
[ruby-core:115465]

Description

The order of instrumentation events is incorrect, and inconsistent with Ruby 3.2 ordering. You can find a spec to reproduce the broken behavior here: https://github.com/ruby/ruby/pull/9019.

Steps to reproduce

  1. Pull down this PR: https://github.com/ruby/ruby/pull/9019
  2. Run make test-all TESTS="../test/-ext-/thread/test_instrumentation_api.rb --name=TestThreadInstrumentation#test_order_of_events"
  3. Run RUBY_MN_THREADS=1 make test-all TESTS="../test/-ext-/thread/test_instrumentation_api.rb --name=TestThreadInstrumentation#test_order_of_events"

Expected behavior

It should pass the spec, and the events for each thread should match the array %w[started ready resumed suspended exited]. That is the consistent behavior on Ruby 3.2.

Actual behavior

When running make test-all TESTS="../test/-ext-/thread/test_instrumentation_api.rb --name=TestThreadInstrumentation#test_order_of_events", the array of events is %w[ready resumed started exited suspended].

When running with RUBY_MN_THREADS=1, the array of events is %w[ready started exited suspended].

Actions #1

Updated by byroot (Jean Boussier) 11 months ago

  • Status changed from Open to Closed

Applied in changeset git|982641939cf709d22dbc060df57cbed31acd3b97.


Further fix the GVL instrumentation API

Followup: https://github.com/ruby/ruby/pull/9029

[Bug #20019]

Some events still weren't triggered from the right place.

The test suite was also improved a bit more.

Actions

Also available in: Atom PDF

Like0
Like1