[#122643] [Ruby Bug#21498] Windows - Ruby Overrides C Library APIs thus breaking them — "cfis (Charlie Savage) via ruby-core" <ruby-core@...>

Issue #21498 has been reported by cfis (Charlie Savage).

9 messages 2025/07/02

[#122658] [Ruby Feature#21501] Include native filenames in backtraces as sources for native methods — "ivoanjo (Ivo Anjo) via ruby-core" <ruby-core@...>

Issue #21501 has been reported by ivoanjo (Ivo Anjo).

10 messages 2025/07/05

[#122665] [Ruby Bug#21503] \p{Word} does not match on \p{Join_Control} while docs say it does — "procmarco (Marco Concetto Rudilosso) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTAzIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHByb2NtYXJjbyAoTWFyY28gQ29uY2V0

8 messages 2025/07/07

[#122734] [Ruby Bug#21511] Use-after-free of the execution context after the fiber object carrying it is freed in GC — "tuonigou (tianyang sun) via ruby-core" <ruby-core@...>

Issue #21511 has been reported by tuonigou (tianyang sun).

10 messages 2025/07/14

[#122797] [Ruby Feature#21515] Add `&return` as sugar for `x=my_calculation; return x if x` — "nhorton (Noah Horton) via ruby-core" <ruby-core@...>

Issue #21515 has been reported by nhorton (Noah Horton).

13 messages 2025/07/16

[#122842] [Ruby Feature#21518] Statistical helpers to `Enumerable` — "Amitleshed (Amit Leshed) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTE4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IEFtaXRsZXNoZWQgKEFtaXQgTGVzaGVk

12 messages 2025/07/23

[#122847] [Ruby Feature#21520] Feature Proposal: Enumerator::Lazy#peek — "nuzair46 (Nuzair Rasheed) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTIwIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IG51emFpcjQ2IChOdXphaXIgUmFzaGVl

12 messages 2025/07/24

[ruby-core:122821] [Ruby Bug#21504] [Ractor] Process.waitpid blocks ractor, new NT doesn't pick up other ractors

From: "luke-gru (Luke Gruber) via ruby-core" <ruby-core@...>
Date: 2025-07-18 21:17:52 UTC
List: ruby-core #122821
Issue #21504 has been updated by luke-gru (Luke Gruber).


This is due to IO (ex: IO#read) registering wait events with the timer thread. When it does this, it wakes the timer thread up. This makes the timer thread check if any new NT needs to be created, and creates one if necessary. A quick fix would be to wake the timer thread when calling Process#waitpid, but there could be other methods affected as well.

----------------------------------------
Bug #21504: [Ractor] Process.waitpid blocks ractor, new NT doesn't pick up other ractors
https://bugs.ruby-lang.org/issues/21504#change-114108

* Author: luke-gru (Luke Gruber)
* Status: Open
* Assignee: ractor
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The following code hangs when run with `RUBY_MAX_CPU=2 make run`:

Note: `RUBY_MAX_CPU` is set to 2 so that only 1 non-main ractor can run at once.

test.rb:
```ruby
rs = []
2.times do |i|
  rs << Ractor.new(i) do |i|
    if i == 0
      io = IO.popen("ruby -e 'sleep'")
      Process.wait(io.pid) # block forever
    else
      sleep 1 # make sure first ractor blocks forever first
      $stderr.puts "Running r #{i}"
      100_000.times do
        [nil] * 1_000
      end
      $stderr.puts "done r #{i}"
    end
  end
end

while rs.size == 2
  r, obj = Ractor.select(*rs)
  rs.delete(r)
end
```

The timer thread should create a new NT to compensate for the dedicated task, and the new NT should be able to pick up the other runnable ractor.

In contrast, the following works fine:

```ruby
rs = []
2.times do |i|
  rs << Ractor.new(i) do |i|
    if i == 0
      r, w = IO.pipe
      r.read(1) # block forever
    else
      sleep 1 # make sure first ractor blocks forever first
      $stderr.puts "Running r #{i}"
      100_000.times do
        [nil] * 1_000
      end
      $stderr.puts "done r #{i}"
    end
  end
end

while rs.size == 2
  r, obj = Ractor.select(*rs)
  rs.delete(r)
end
```



-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/


In This Thread