Project

General

Profile

Actions

Bug #21880

open

The ultra_safe mode of pstore bundled with Ruby 4.0 is broken.

Bug #21880: The ultra_safe mode of pstore bundled with Ruby 4.0 is broken.

Added by s3fxn (s3 fxn) 8 days ago. Updated 7 days ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:124825]

Description

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

Updated by bkuhlmann (Brooke Kuhlmann) 7 days ago Actions #1 [ruby-core:124831]

ℹ️ This is also documented in Issue 22.

Updated by nobu (Nobuyoshi Nakada) 7 days ago Actions #2

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) 7 days ago Actions #4

  • Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED

Updated by nobu (Nobuyoshi Nakada) 7 days ago Actions #5 [ruby-core:124839]

4.0 needs to backport gems/bundled_gems, and 3.2..3.4 need lib/pstore.rb.

Actions

Also available in: PDF Atom