ml.ruby-lang.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ruby-core

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
ruby-core@ml.ruby-lang.org

  • 1 participants
  • 3827 discussions
[ruby-core:124825] [Ruby Bug#21880] The ultra_safe mode of pstore bundled with Ruby 4.0 is broken.
by s3fxn (s3 fxn) 09 May '26

09 May '26
Issue #21880 has been reported by s3fxn (s3 fxn). ---------------------------------------- Bug #21880: The ultra_safe mode of pstore bundled with Ruby 4.0 is broken. https://bugs.ruby-lang.org/issues/21880 * Author: s3fxn (s3 fxn) * Status: Open * ruby -v: 4.0 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- here is the reproduction code. $ ruby -v ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [x86_64-linux] $ cat pstore.rb #!/usr/bin/env ruby require "bundler/inline" gemfile do source "https://rubygems.org" if ENV['DEBUG'] gem "pstore", "0.1.4" else gem "pstore" end end db = PStore.new("pstore.db") db.ultra_safe = true db.transaction do puts db["now"] = Time.now end $ ruby pstore.rb 2026-02-15 04:49:31 +0000 /home/s3fxn/.rubies/ruby-4.0.1/lib/ruby/gems/4.0.0/gems/pstore-0.2.0/lib/pstore.rb:676:in 'Ractor.make_shareable': Proc's self is not shareable: #<Proc:0x0000749f688df078 /home/s3fxn/.rubies/ruby-4.0.1/lib/ruby/gems/4.0.0/gems/pstore-0.2.0/lib/pstore.rb:673> (Ractor::IsolationError) from /home/s3fxn/.rubies/ruby-4.0.1/lib/ruby/gems/4.0.0/gems/pstore-0.2.0/lib/pstore.rb:676:in 'PStore#on_windows?' from /home/s3fxn/.rubies/ruby-4.0.1/lib/ruby/gems/4.0.0/gems/pstore-0.2.0/lib/pstore.rb:685:in 'PStore#save_data' from /home/s3fxn/.rubies/ruby-4.0.1/lib/ruby/gems/4.0.0/gems/pstore-0.2.0/lib/pstore.rb:575:in 'PStore#transaction' from pstore.rb:14:in '<main>' $ DEBUG=1 ruby pstore.rb 2026-02-15 04:49:53 +0000 -- https://bugs.ruby-lang.org/
6 6
0 0
[ruby-core:124604] [Ruby Bug#21847] Backport `syntax_suggest` 2.0.3 to supported branches
by Earlopain (Earlopain _) 09 May '26

09 May '26
Issue #21847 has been reported by Earlopain (Earlopain _). ---------------------------------------- Bug #21847: Backport `syntax_suggest` 2.0.3 to supported branches https://bugs.ruby-lang.org/issues/21847 * Author: Earlopain (Earlopain _) * Status: Open * Backport: 3.2: DONTNEED, 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- Prism contains a translation layer for ripper, which until very recently didn't emit `on_sp` tokens. This has now been implemented to improve compatibility. However right after merging some `syntax_suggest` tests started failing: https://gist.github.com/schneems/834c75345b2085bda54dab69d913bcc0. `syntax_suggest` is using the ripper translation layer and is working around the missing `on_sp` tokens. Now that they are correctly created by prism, `syntax_suggest` is not able to handle these. For prism this is just a bugfix but I do not want to break `syntax_suggest` unnecessarily. I asked @schneems and this is what he had to say about it: https://github.com/ruby/syntax_suggest/pull/243#issuecomment-3779113958 Backport PRs: -- https://bugs.ruby-lang.org/
4 3
0 0
[ruby-core:124950] [Ruby Bug#21947] `Timeout.timeout` doesn't use `Timeout::ExitException` when Fiber scheduler is in use.
by ioquatix (Samuel Williams) 09 May '26

09 May '26
Issue #21947 has been reported by ioquatix (Samuel Williams). ---------------------------------------- Bug #21947: `Timeout.timeout` doesn't use `Timeout::ExitException` when Fiber scheduler is in use. https://bugs.ruby-lang.org/issues/21947 * Author: ioquatix (Samuel Williams) * Status: Open * Assignee: ioquatix (Samuel Williams) * Backport: 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- The following example executes successfully after 7 seconds instead of timing out after 2. ```ruby require 'async' require 'net/http' start = Time.now Sync do Timeout.timeout 2 do Net::HTTP.get(URI 'https://httpbin.org/delay/5') puts "...request finished, no timeout though; in #{Time.now - start}s" end end puts "Duration: #{Time.now - start}s" # => ...request finished, no timeout though; in 7.7007s # Duration: 7.700962s ``` There are two issues: - `Net::HTTP` rescues `Timeout::Error` and retries. This causes 2s (timeout -> retry) + 5s execution time. - `Timeout.timeout` uses `Timeout::ExitException` when no exception is specified, but the Fiber scheduler code path was not updated. See <https://github.com/socketry/async/issues/448> for more discussion. -- https://bugs.ruby-lang.org/
3 4
0 0
[ruby-core:124920] [Ruby Bug#21941] Local variable becomes nil when YJIT enabled mid-method with fork/signal/ensure
by nicholasdower (Nick Dower) 09 May '26

09 May '26
Issue #21941 has been reported by nicholasdower (Nick Dower). ---------------------------------------- Bug #21941: Local variable becomes nil when YJIT enabled mid-method with fork/signal/ensure https://bugs.ruby-lang.org/issues/21941 * Author: nicholasdower (Nick Dower) * Status: Open * ruby -v: ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [arm64-darwin25] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- The following code results in the `read` local variable becoming nil, even though it is never reassigned: ``` def run fork_safe = ->(t) { t } RubyVM::YJIT.enable read, wakeup = IO.pipe Signal.trap("SIGCHLD") { wakeup.write("!") } begin while true begin fork { exit } next if read.wait_readable rescue Interrupt end end ensure end end run ``` Error: ``` repro.rb:13:in 'Object#run': undefined method 'wait_readable' for nil (NoMethodError) next if read.wait_readable ^^^^^^^^^^^^^^ from repro.rb:21:in '<main>' ``` See also: https://github.com/puma/puma/issues/3620 https://github.com/Shopify/ruby/issues/625 -- https://bugs.ruby-lang.org/
5 5
0 0
[ruby-core:125003] [Ruby Feature#21953] Allow accessing unshareable objects within a Ractor-local Ruby Box
by tikkss (Tsutomu Katsube) 08 May '26

08 May '26
Issue #21953 has been reported by tikkss (Tsutomu Katsube). ---------------------------------------- Feature #21953: Allow accessing unshareable objects within a Ractor-local Ruby Box https://bugs.ruby-lang.org/issues/21953 * Author: tikkss (Tsutomu Katsube) * Status: Open ---------------------------------------- ### Status Currently, non-main ractors prohibit access to the following objects to prevent data races: * Global variables * Class variables * Unshareable class instance variables * Unshareable constants ### Proposal I would like to propose that allow reading/writing unshareable objects inside a Ruby Box created in a non-main ractor: ```ruby # lib/x.rb class X # can write unshareable objects XXX = "1" @@cvar = "1" @ivar = "1" class << self def cvar; @@cvar; end def ivar; @ivar; end end end # can read unshareable objects $LOAD_PATH # => returns $LOAD_PATH includes lib directory X.cvar # => "1" X.ivar # => "1" X::XXX # => "1" # main.rb Ractor.new do local_box = Ruby::Box.new local_box.eval <<~RUBY base_dir = File.expand_path(File.dirname(__FILE__)) lib_dir = File.join(base_dir, "lib") # can write unshareable objects $LOAD_PATH.unshift(lib_dir) RUBY local_box.require("x") x = local_box::X.new end.join ``` Ruby Box can isolate global/class variables, class/module definitions from other boxes. A Ruby Box created inside a non-main ractor cannot be accessed from other ractor. If that is the case, wouldn’t it be fine to access unshareable objects inside that box? So I would like to propose that allow reading/writing unshareable objects inside a Ruby Box created in a non-main ractor. ### Background We are working on implementing a Ractor based parallel test runner for the test-unit gem. Ractor is a great for parallel processing. However, many existing libraries still rely on class variables or class instance variables for configuration. Ideally, we should reduce the use of class variables or class instance variables. Currently, we tried fixing several non-shareable objects, but we could not resolve all of them yet. We will continue working on this issue, but we are also exploring other approaches. This is the idea begind this proposal. I think the work needed to make objects shareable when running exisiting libraries with Ractor can be reduced. ### FAQ Q: Can we create a Ruby Box inside a non-main ractor? A: Yes: ```ruby Ractor.new {Ruby::Box.new}.join ``` Q: Is a Ruby Box created in a non-main ractor truly inaccessible from other ractor? A: No. I'm not sure if it's intentional, but a Ruby Box is a shareable object. Also, it can be accessed from the main Ractor by using `Ractor#value`: ```ruby Ractor.shareable?(Ruby::Box.new) # => true ``` ```ruby Ractor.new {Ruby::Box.new}.value # => #<Ruby::Box:3,user,optional> ``` To implement this proposal, Ruby Box may need to be an unshareable object, and passing it with `Ractor#value` may need to be disallowed. -- https://bugs.ruby-lang.org/
4 8
0 0
[ruby-core:125235] [Ruby Bug#21991] `$!` stays as the first exception in Ruby Box
by tikkss (Tsutomu Katsube) 08 May '26

08 May '26
Issue #21991 has been reported by tikkss (Tsutomu Katsube). ---------------------------------------- Bug #21991: `$!` stays as the first exception in Ruby Box https://bugs.ruby-lang.org/issues/21991 * Author: tikkss (Tsutomu Katsube) * Status: Open * ruby -v: ruby 4.0.2 (2026-03-17 revision d3da9fec82) +PRISM [x86_64-darwin24] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Description --- When Ruby Box is enabled (`RUBY_BOX=1`), `$!` inside `rescue` does not change after the first exception. `$!` is expected to show the exception for each `rescue` block, but it always shows the first one. Steps to reproduce --- ```ruby # test.rb begin raise "First error" rescue pp $! end begin raise "Second error" rescue pp $! end begin raise "Third error" rescue pp $! end ``` Expected result --- ```console $ RUBY_BOX=1 ruby test.rb ruby: warning: Ruby::Box is experimental, and the behavior may change in the future! See https://docs.ruby-lang.org/en/4.0/Ruby/Box.html for known issues, etc. #<RuntimeError: First error> #<RuntimeError: Second error> #<RuntimeError: Third error> ``` Actual result --- ```console $ RUBY_BOX=1 ruby test.rb ruby: warning: Ruby::Box is experimental, and the behavior may change in the future! See https://docs.ruby-lang.org/en/4.0/Ruby/Box.html for known issues, etc. #<RuntimeError: First error> #<RuntimeError: First error> #<RuntimeError: First error> ``` Additional information --- This issue does not reproduce when `RUBY_BOX=1` is not set: ```console $ ruby test.rb #<RuntimeError: First error> #<RuntimeError: Second error> #<RuntimeError: Third error> ``` Also, this issue does not reproduce when the exception object is captured explicitly in the `rescue` clause: ```ruby # test.rb begin raise "First error" rescue => e pp e end begin raise "Second error" rescue => e pp e end begin raise "Third error" rescue => e pp e end ``` ```console $ RUBY_BOX=1 ruby test.rb ruby: warning: Ruby::Box is experimental, and the behavior may change in the future! See https://docs.ruby-lang.org/en/4.0/Ruby/Box.html for known issues, etc. #<RuntimeError: First error> #<RuntimeError: Second error> #<RuntimeError: Third error> ``` -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:125397] [Ruby Bug#22021] Array#delete_if may delete wrong object if array has been altered already
by chucke (Tiago Cardoso) 05 May '26

05 May '26
Issue #22021 has been reported by chucke (Tiago Cardoso). ---------------------------------------- Bug #22021: Array#delete_if may delete wrong object if array has been altered already https://bugs.ruby-lang.org/issues/22021 * Author: chucke (Tiago Cardoso) * Status: Open * ruby -v: 4.0.2 * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- The simplest example I can come up with: ```ruby $ar = ar = [1, 2, 3, 4, 5] def delete_at(i) $ar.delete(i) end ar.delete_if { |i| i == 2 ? (delete_ar(i) && true) : false } ar #=> [1, 4, 5], and it should be [1, 3, 4, 5] ``` -- https://bugs.ruby-lang.org/
2 4
0 0
[ruby-core:125403] [Ruby Bug#22023] Backport commits cba70c3532c34803bae065745b799103635ec67a and cfdca23bfecb5fb74fd31128ac37d734d8e7e43b
by byroot (Jean Boussier) 05 May '26

05 May '26
Issue #22023 has been reported by byroot (Jean Boussier). ---------------------------------------- Bug #22023: Backport commits cba70c3532c34803bae065745b799103635ec67a and cfdca23bfecb5fb74fd31128ac37d734d8e7e43b https://bugs.ruby-lang.org/issues/22023 * Author: byroot (Jean Boussier) * Status: Closed * Backport: 3.3: WONTFIX, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- - Fix passing frozen_string_literal option to #compile_file backed by Prism: https://github.com/ruby/ruby/pull/16779 - ISeq.compile_file was not switching on parser: https://github.com/ruby/ruby/pull/16463 -- https://bugs.ruby-lang.org/
2 3
0 0
[ruby-core:125377] [Ruby Bug#22018] ISeq created via `RubyVM::InstructionSequence.compile` don't support coverage
by byroot (Jean Boussier) 05 May '26

05 May '26
Issue #22018 has been reported by byroot (Jean Boussier). ---------------------------------------- Bug #22018: ISeq created via `RubyVM::InstructionSequence.compile` don't support coverage https://bugs.ruby-lang.org/issues/22018 * Author: byroot (Jean Boussier) * Status: Open * Backport: 3.3: WONTFIX, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- Reproduction: ```ruby require "coverage" File.write("/tmp/a.rb", <<~RUBY) module CoverableRaw def self.call "cover up" end end CoverableRaw.call RUBY Coverage.start require "/tmp/a.rb" p Coverage.result File.write("/tmp/b.rb", <<~RUBY) module Coverable def self.call "cover up" end end Coverable.call RUBY class RubyVM::InstructionSequence def self.load_iseq(path) compile_file(path) end end Coverage.start require "/tmp/b.rb" p Coverage.result ``` Expected: ```ruby {"/tmp/a.rb" => [1, 1, 1, nil, nil, nil, 1]} {"/tmp/b.rb" => [1, 1, 1, nil, nil, nil, 1]} ``` Actual: ```ruby {"/tmp/a.rb" => [1, 1, 1, nil, nil, nil, 1]} {} ``` Patch: https://github.com/ruby/ruby/pull/16805 -- https://bugs.ruby-lang.org/
2 3
0 0
[ruby-core:125396] [Ruby Bug#22020] Inner call node without all arguments returned by RubyVM::AbstractSyntaxTree.of for call with a block
by Eregon (Benoit Daloze) 04 May '26

04 May '26
Issue #22020 has been reported by Eregon (Benoit Daloze). ---------------------------------------- Bug #22020: Inner call node without all arguments returned by RubyVM::AbstractSyntaxTree.of for call with a block https://bugs.ruby-lang.org/issues/22020 * Author: Eregon (Benoit Daloze) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ```ruby begin foo(1, 2, kw: :arg) { 42 } rescue => e pp RubyVM::AbstractSyntaxTree.of e.backtrace_locations[0] end ``` ``` $ ruby --parser=parse.y rubyvm_ast_node_id_loc.rb (FCALL@2:2-2:21 :foo (LIST@2:6-2:20 (INTEGER@2:6-2:7 1) (INTEGER@2:9-2:10 2) (HASH@2:12-2:20 (LIST@2:12-2:20 (SYM@2:12-2:15 :kw) (SYM@2:16-2:20 :arg) nil)) nil)) ``` That covers `foo(1, 2, kw: :arg)` so all arguments except the block argument, which looks inconsistent. I believe it should be: ``` $ ruby --parser=parse.y rubyvm_ast_node_id_loc.rb (ITER@2:2-2:28 (FCALL@2:2-2:21 :foo (LIST@2:6-2:20 (INTEGER@2:6-2:7 1) (INTEGER@2:9-2:10 2) (HASH@2:12-2:20 (LIST@2:12-2:20 (SYM@2:12-2:15 :kw) (SYM@2:16-2:20 :arg) nil)) nil)) (SCOPE@2:22-2:28 tbl: [] args: nil body: (INTEGER@2:24-2:26 42))) ``` PR: https://github.com/ruby/ruby/pull/16836 -- https://bugs.ruby-lang.org/
1 2
0 0
  • ← Newer
  • 1
  • ...
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • ...
  • 383
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.