Project

General

Profile

Actions

Bug #20019

closed

Ruby 3.3 GVL instrumentation events are fired out of order

Added by jpcamara (JP Camara) 11 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

Also available in: Atom PDF

Like0
Like1