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 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • 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

September 2026

  • 2 participants
  • 177 discussions
[ruby-core:126658] [Ruby Misc#22275] Ruby::Box support plan for RubyGems and Bundler
by hsbt (Hiroshi SHIBATA) 25 Sep '26

25 Sep '26
Issue #22275 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Misc #22275: Ruby::Box support plan for RubyGems and Bundler https://bugs.ruby-lang.org/issues/22275 * Author: hsbt (Hiroshi SHIBATA) * Status: Open ---------------------------------------- This is a tracking issue for making RubyGems and Bundler work with Ruby::Box, so that reviewers can see the whole picture and what to look at next in one place. ## Goal The goal is to realize [Feature #13847](https://bugs.ruby-lang.org/issues/13847) with Ruby::Box: loading a specific version of a gem, including default gems and C extensions, isolated from the copy that RubyGems/Bundler themselves use. Vendoring with namespace rewriting has been our workaround for pure-Ruby gems for years; Box removes that limitation. As a further step, we want RubyGems/Bundler to activate different gem versions per box, which enables the use cases already proposed around Box: gradual dependency upgrades, plugin systems with conflicting dependencies, and multiple applications in one process. ## First milestone Before designing such APIs, Box needs to leave experimental status. Our first milestone is that Rails and RubyGems/Bundler themselves work under `RUBY_BOX=1`, and that the ruby/rubygems repository runs its test suites with Box enabled continuously so we do not regress. ## Current status Both suites now run under `RUBY_BOX=1` with the pull requests below applied. The rubygems suite is at 0 failures ([ruby/rubygems#9826](https://github.com/ruby/rubygems/pull/9826), open). The bundler suite runs 3957 examples with box and non-box at parity; the single remaining failure is an unrelated upstream problem in a Rust extension test. Pending marks reference the unfixed core bugs below. ## Fixed ### ruby/ruby * [ruby/ruby#18218](https://github.com/ruby/ruby/pull/18218) / [ruby/ruby#18219](https://github.com/ruby/ruby/pull/18219) — `BUNDLER_SETUP` was consumed outside the main box ([Bug #22123](https://bugs.ruby-lang.org/issues/22123)). Shipped in 4.0.7. * [ruby/ruby#18509](https://github.com/ruby/ruby/pull/18509) — box-local extension DLLs on Windows were unloaded too early; now deferred. * [ruby/ruby#18534](https://github.com/ruby/ruby/pull/18534) — autoload-triggered require bypassed the box's `Kernel#require` ([Bug #21830](https://bugs.ruby-lang.org/issues/21830)). This alone took Rails from 500 on every request to fully working. * [ruby/ruby#18535](https://github.com/ruby/ruby/pull/18535) — with `--disable=gems`, modules prepended to `Kernel` in a user box ended up behind `Kernel` in the ancestry ([Bug #22270](https://bugs.ruby-lang.org/issues/22270)). * [ruby/ruby#18536](https://github.com/ruby/ruby/pull/18536) — the box extension copy embedded the full path in the temporary filename, exceeding NAME_MAX on deep paths, and the name was predictable ([Bug #22110](https://bugs.ruby-lang.org/issues/22110), [Bug #22271](https://bugs.ruby-lang.org/issues/22271)). * [ruby/ruby#18578](https://github.com/ruby/ruby/pull/18578) — the process-private directory added by the previous fix did not survive `fork`; a forked child removed it at exit ([Bug #22271](https://bugs.ruby-lang.org/issues/22271)). * [ruby/ruby#18575](https://github.com/ruby/ruby/pull/18575) — box resolution crashed on an IFUNC frame ([Bug #21977](https://bugs.ruby-lang.org/issues/21977)). Without this the bundler suite died with `[BUG]` and the dead workers cascaded into unrelated failures. * [ruby/ruby#18546](https://github.com/ruby/ruby/pull/18546) — `Symbol#to_proc` ignored box-local method definitions ([Bug #22015](https://bugs.ruby-lang.org/issues/22015), revived [ruby/ruby#16865](https://github.com/ruby/ruby/pull/16865)) Without this Bundler's spec harness died in rspec-core's `&:shellsplit` before running a single spec. ### ruby/rubygems * [ruby/rubygems#9809](https://github.com/ruby/rubygems/pull/9809) — Bundler evaluated gemspecs through `TOPLEVEL_BINDING`, which always belongs to the main box. It now uses a binding in the box Bundler is loaded in, so gemspecs resolve the right `Gem::Specification`. * [ruby/rubygems#9810](https://github.com/ruby/rubygems/pull/9810) — the `gem` CLI died under `RUBY_BOX=1`. `Marshal`-based deep copies could not resolve `Gem::` constants across boxes and were replaced with a plain deep dup, and `RUBY_BOX` is now stripped from extension build subprocesses, where mkmf `have_devel?` recurses until `SystemStackError` ([Bug #22283](https://bugs.ruby-lang.org/issues/22283)). Includes a CLI canary test that runs under `RUBY_BOX=1`. ## Open pull requests All review-requested to @tagomoris: * [ruby/ruby#18544](https://github.com/ruby/ruby/pull/18544) — `Marshal.load` resolves classes in the root box ([Bug #22090](https://bugs.ruby-lang.org/issues/22090)); an in-process round-trip of `Gem::Version` fails today. Under review. * [ruby/ruby#18574](https://github.com/ruby/ruby/pull/18574) — reassigning `$stdout`/`$stderr` is invisible to builtin writers ([Bug #21867](https://bugs.ruby-lang.org/issues/21867)), which breaks output-capturing test helpers everywhere. * [ruby/ruby#18577](https://github.com/ruby/ruby/pull/18577) — `$?` is uninitialized after `Kernel#system` and `IO.popen` ([Bug #22280](https://bugs.ruby-lang.org/issues/22280)). * [ruby/ruby#18579](https://github.com/ruby/ruby/pull/18579) — assignments to `$VERBOSE` and `$DEBUG` have no effect ([Bug #22282](https://bugs.ruby-lang.org/issues/22282)). * [ruby/ruby#18586](https://github.com/ruby/ruby/pull/18586) — `defined?` does not see global variables assigned in a box ([Bug #22283](https://bugs.ruby-lang.org/issues/22283)). This is why mkmf `have_devel?` never memoizes and recurses until the stack is exhausted, which is the "stack level too deep in extconf.rb" entry under Known issues in `doc/language/box.md`. ## Remaining problems without a fix * [Bug #22295](https://bugs.ruby-lang.org/issues/22295) — `ruby -r<gem>` and `RUBYOPT=-r<gem>` do not activate gems under Box. `require_libraries_in_main_box()` calls `rb_require_string()` directly, bypassing the RubyGems `Kernel#require` override. Item 3 of [Bug #21760](https://bugs.ruby-lang.org/issues/21760) reports the same gap in `Ruby::Box#require`. * [Misc #22296](https://bugs.ruby-lang.org/issues/22296) — stubbing a core class does not reach code already loaded in the root box, so existing test suites change behaviour under Box without failing loudly. `allow(File).to receive(:expand_path)` in the main box leaves `Pathname#expand_path` calling the real method. We hit this in the Bundler suite and scoped the stub as a workaround, but existing test code cannot be expected to know the rule. If this is intended box semantics, it should be documented as a known limitation, because rspec-mocks style stubbing of core classes is everywhere. ## Critical path [ruby/ruby#18544](https://github.com/ruby/ruby/pull/18544) is the last item on the critical path, because without it the artifice-based install specs fail wholesale. [ruby/ruby#18546](https://github.com/ruby/ruby/pull/18546) and [ruby/ruby#18575](https://github.com/ruby/ruby/pull/18575) were the other two and are now merged. [ruby/ruby#18574](https://github.com/ruby/ruby/pull/18574) and [ruby/ruby#18577](https://github.com/ruby/ruby/pull/18577) then let us drop most of the pending marks. -- https://bugs.ruby-lang.org/
3 5
0 0
[ruby-core:126851] [Ruby Bug#22382] IO#write of a shareable String from multiple Ractors causes use-after-free
by jamescook83 (James Cook) 25 Sep '26

25 Sep '26
Issue #22382 has been reported by jamescook83 (James Cook). ---------------------------------------- Bug #22382: IO#write of a shareable String from multiple Ractors causes use-after-free https://bugs.ruby-lang.org/issues/22382 * Author: jamescook83 (James Cook) * Status: Open * ruby -v: ruby 4.0.7 (2026-09-15 revision 229531a6cf) +PRISM [arm64-darwin25] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- When several Ractors `IO#write` the same shareable, heap-allocated (non-embedded) String at the same moment, Ruby frees the String's buffer while the String is still alive. A later GC sweep double-frees it and aborts. **Reproduction** ```ruby # frozen_string_literal: true require "tmpdir" dir = Dir.mktmpdir TRIES = 300 1.upto(TRIES) do |try| $stderr.puts "try #{try} of #{TRIES}" str = Ractor.make_shareable(Random.bytes(512 * 1024)) # Control: one prior write from a single Ractor prevents the crash. File.binwrite(File.join(dir, "first"), str) if ENV["WRITE_FIRST"] go = Process.clock_gettime(Process::CLOCK_MONOTONIC) + 0.02 12.times.map do |n| Ractor.new(str, File.join(dir, "w#{n}"), go) do |s, path, at| Thread.pass until Process.clock_gettime(Process::CLOCK_MONOTONIC) >= at # start together File.binwrite(path, s) end end.each(&:join) GC.start end puts "finished #{TRIES} tries without crashing" ``` ``` try 9 of 300 <internal:gc>:44: [BUG] Aborted at 0x000000018e37e5e8 ruby 4.0.7 (2026-09-15 revision 229531a6cf) +PRISM [arm64-darwin25] ... libruby.4.0.dylib(_rb_gc_impl_free+0x50) libruby.4.0.dylib(_rb_gc_obj_free+0x1e8) libruby.4.0.dylib(_gc_sweep_plane+0x150) ``` macOS reports the abort as `POINTER_BEING_FREED_WAS_NOT_ALLOCATED`. Crashes 5 runs out of 5. With `WRITE_FIRST=1` (each String written once, from one Ractor, before the race) it finishes without crashing. **Cause** The crash goes away when each String is written once from a single Ractor first (WRITE_FIRST=1), which points at rb_str_tmp_frozen_no_embed_acquire (io.c:2038): on a String's first write it hands the String's buffer to a new String and re-points the String at it (string.c:1573). The same function was changed for fstrings in #21671. A similar issue around fstrings was resolved in #21671. ---Files-------------------------------- ractor_shareable_write_repro.rb (704 Bytes) -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:125612] [Ruby Bug#22092] `Array#sum` takes slow path, does not perform compensated summation of Float elements when init argument is a Float
by georgeclaghorn (George Claghorn) 25 Sep '26

25 Sep '26
Issue #22092 has been reported by georgeclaghorn (George Claghorn). ---------------------------------------- Bug #22092: `Array#sum` takes slow path, does not perform compensated summation of Float elements when init argument is a Float https://bugs.ruby-lang.org/issues/22092 * Author: georgeclaghorn (George Claghorn) * Status: Open * ruby -v: ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [arm64-darwin24] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ``` % time ruby -e 'puts Array.new(1_000_000_000, 0.1).sum' 100000000.0 ruby -e 'puts Array.new(1_000_000_000, 0.1).sum' 2.67s user 2.02s system 71% cpu 6.577 total % time ruby -e 'puts Array.new(1_000_000_000, 0.1).sum(0.0)' 99999998.74541782 ruby -e 'puts Array.new(1_000_000_000, 0.1).sum(0.0)' 22.72s user 1.80s system 96% cpu 25.332 total ``` Both the fast path and compensated summation are undocumented implementation details as far as I know, but this appears to be a possible oversight. -- https://bugs.ruby-lang.org/
4 3
0 0
[ruby-core:126842] [Ruby Bug#22378] `Ractor::IsolationError` in code not using Ractors
by Earlopain (Earlopain _) 23 Sep '26

23 Sep '26
Issue #22378 has been reported by Earlopain (Earlopain _). ---------------------------------------- Bug #22378: `Ractor::IsolationError` in code not using Ractors https://bugs.ruby-lang.org/issues/22378 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 4.1.0dev (2026-09-23T07:42:54Z master 8cdc7b5957) +PRISM [x86_64-linux] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ```rb # Reduced from the `httpx` gem @var = Class.new.freeze.dup @var.instance_variable_set(:@test, 123) ``` I expect this code to succeed. dup returns an unfrozen copy, so I should be able to set instance variables on it. However, I get the following error even though the code is ractor-free: ``` test.rb:2:in 'Kernel#instance_variable_set': can't modify instance variables of a shareable Class (Ractor::IsolationError) ``` It works on 4.0 but fails on current master. Behaviour changed recently, maybe #22291, but I haven't confirmed it. -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:126449] [Ruby Bug#22254] [Prism] Clang UBSan reports NULL/0 memcpy while serializing empty strings
by yqtian (Yongqiang Tian) 23 Sep '26

23 Sep '26
Issue #22254 has been reported by yqtian (Yongqiang Tian). ---------------------------------------- Bug #22254: [Prism] Clang UBSan reports NULL/0 memcpy while serializing empty strings https://bugs.ruby-lang.org/issues/22254 * Author: yqtian (Yongqiang Tian) * Status: Open * ruby -v: ruby 4.1.0dev (2026-08-20T02:56:29Z master ed0b427b4b) +PRISM [x86_64-linux] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- I found a public `Prism.dump` path that passes a null source and zero length to `memcpy` in Prism's buffer helper. Clang's `nonnull-attribute` sanitizer reports the call because the effective glibc declaration marks the first two `memcpy` arguments as nonnull. I have not observed a crash, output corruption, or an ordinary non-sanitized failure. I am reporting this as a C correctness/toolchain-contract issue, not a security issue. #### Environment ```text x86-64 Ubuntu Clang 18.1.3 Ruby revision: ed0b427b4ba3c776c763d2673070e88372b2096a Relevant sanitizer: -fsanitize=nonnull-attribute Optimization: -O1 ``` I also checked Ruby HEAD `4012a96bf084d035bf582d58c7dafb31f4762ac6` and the corresponding Prism HEAD `3ea210b30108432b8b75b979872f4fa3c23acb7b`; the source site was unchanged. #### Reproduction From a Ruby checkout, create an out-of-tree build with the same flags used in the validation: ```sh ./autogen.sh mkdir build-ubsan cd build-ubsan ../configure \ CC=clang-18 \ CXX=clang++-18 \ CFLAGS="-fsanitize=nonnull-attribute,returns-nonnull-attribute,nullability-arg,nullability-return,nullability-assign -fsanitize-recover=all -fno-omit-frame-pointer -g -O1" \ CXXFLAGS="-fsanitize=nonnull-attribute,returns-nonnull-attribute,nullability-arg,nullability-return,nullability-assign -fsanitize-recover=all -fno-omit-frame-pointer -g -O1" \ LDFLAGS="-fsanitize=nonnull-attribute,returns-nonnull-attribute,nullability-arg,nullability-return,nullability-assign -fsanitize-recover=all" \ optflags="-O1" \ debugflags="-g" \ --disable-install-doc \ --with-baseruby=/usr/bin/ruby make -j4 UBSAN_OPTIONS=print_stacktrace=0:halt_on_error=0:report_error_type=1 \ ruby ../tool/runruby.rb -- -rprism -e 'Prism.dump("//")' ``` Clang reports: ```text prism/buffer.c:86:40: runtime error: null pointer passed as argument 2, which is declared to never be null ``` Other reproducing inputs include `%r{}`, `//im`, and an empty quoted symbol. Nonempty regexps and symbols, an ordinary empty string, and `%q[]` were clean controls. #### Cause Some Prism node fields use a null-backed empty string representation. `pm_serialize_string` passes the source and zero length through `pm_buffer_append_bytes` to: ```c static PRISM_INLINE void pm_buffer_append(pm_buffer_t *buffer, const void *source, size_t length) { size_t cursor = buffer->length; if (pm_buffer_append_length(buffer, length)) { memcpy(buffer->value + cursor, source, length); } } ``` A sink-side repair is: ```c if (pm_buffer_append_length(buffer, length)) { if (length > 0) { memcpy(buffer->value + cursor, source, length); } } ``` Another possibility is to skip `pm_buffer_append_bytes` when `length == 0` in the serialization template, preserving a stricter buffer-helper invariant. Should the buffer append helpers define a zero-length append as a no-op even when the source is null, or should the serialization caller filter null-backed empty strings? #### Validation I built unmodified and guarded trees with identical Docker/compiler/configure flags. The reproducing `Prism.dump` inputs report in the unmodified build and are clean in both recover and `halt_on_error=1` modes after adding the buffer guard. The unmodified and guarded builds produced byte-identical output for `Prism.dump("//")`: ```text SHA-256 eff5e01617aa527a49aa3b900589b163e4e396807ba252e8440c8a8fbfe047a5 ``` The same native test set passed in both builds, including 1,003 Prism dump tests with 403,474 assertions, plus Prism freeze/parse and Ruby eval/proc/syntax tests. The guarded build produced no `buffer.c` report in this test set. I would be happy to prepare a patch after confirming whether the preferred repair belongs in the common buffer helper or the serialization template. -- https://bugs.ruby-lang.org/
2 4
0 0
[ruby-core:126833] [Ruby Bug#22377] compile.c: `getlocal` not turned into `getlocal_WC_0`
by alanwu (Alan Wu) 23 Sep '26

23 Sep '26
Issue #22377 has been reported by alanwu (Alan Wu). ---------------------------------------- Bug #22377: compile.c: `getlocal` not turned into `getlocal_WC_0` https://bugs.ruby-lang.org/issues/22377 * Author: alanwu (Alan Wu) * Status: Open * Backport: 3.3: DONTNEED, 3.4: DONTNEED, 4.0: DONTNEED ---------------------------------------- Missed by the "operands_unification" pass, somehow. See 0023 below: ```text $ ./miniruby --parser=parse.y --dump=insns -e ' assign = ->(outer) { m = Module.new m.set_temporary_name("m") # non-leaf call, so the next getlocal needs a patch point outer::M = m [m.name, outer::M.name] }' == disasm: #<ISeq:<main>@-e:1 (1,0)-(7,9)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] assign@0 0000 putspecialobject 1 ( 2)[Li] 0002 send <calldata!mid:lambda, argc:0, FCALL>, block in <main> 0005 dup 0006 setlocal_WC_0 assign@0 0008 leave == disasm: #<ISeq:block in <main>@-e:2 (2,17)-(7,9)> local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 2] outer@0<AmbiguousArg>[ 1] m@1 0000 putnil ( 3)[LiBc] 0001 opt_getconstant_path <ic:0 Module> 0003 opt_new <calldata!mid:new, argc:0, ARGS_SIMPLE>, 10 0006 opt_send_without_block <calldata!mid:initialize, argc:0, FCALL|ARGS_SIMPLE> 0008 jump 13 0010 opt_send_without_block <calldata!mid:new, argc:0, ARGS_SIMPLE> 0012 swap 0013 pop 0014 setlocal_WC_0 m@1 0016 getlocal_WC_0 m@1 ( 4)[Li] 0018 dupchilledstring "m" 0020 opt_send_without_block <calldata!mid:set_temporary_name, argc:1, ARGS_SIMPLE> 0022 pop * 0023 getlocal m@1, 0 ( 5)[Li] 0026 getlocal_WC_0 outer@0 0028 setconstant :M 0030 getlocal_WC_0 m@1 ( 6)[Li] 0032 opt_send_without_block <calldata!mid:name, argc:0, ARGS_SIMPLE> 0034 getlocal_WC_0 outer@0 0036 putobject false 0038 getconstant :M 0040 opt_send_without_block <calldata!mid:name, argc:0, ARGS_SIMPLE> 0042 newarray 2 0044 leave ( 7)[Br] ``` Seems to only happen on trunk and not to be an issue on 4.0.x, 3.4.x, 3.3.x. https://godbolt.org/z/TG9h1j37h Seems to have started with commit:f4813a34c2 "compile.c: statically resolve `swap` instructions when possible" as its parent commit doesn't have this issue. CC: @byroot -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:126831] [Ruby Bug#22375] `Time.new(String)` can disagree with itself about the date
by rwstauner (Randy Stauner) 22 Sep '26

22 Sep '26
Issue #22375 has been reported by rwstauner (Randy Stauner). ---------------------------------------- Bug #22375: `Time.new(String)` can disagree with itself about the date https://bugs.ruby-lang.org/issues/22375 * Author: rwstauner (Randy Stauner) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- `Time.new("2026-02-30T00:00:00Z")` returns a `Time` object that is internally inconsistent. It shows as Feb 30 or Mar 2 depending on what methods are called: ```ruby t = Time.new("2026-02-30T00:00:00Z") # => 2026-02-30 00:00:00 UTC t.mon # => 2 t.day # => 30 (February 30 is invalid) t.to_i # => 1772409600 Time.utc(2026, 3, 2).to_i # => 1772409600 # (Mar 2 gives same #to_i result) t == Time.utc(2026, 3, 2) # => true t + 0 # => 2026-03-02 00:00:00 UTC # plus zero normalizes t # => 2026-02-30 00:00:00 UTC # still invalid t.to_a # => [0, 0, 0, 2, 3, 2026, 1, 61, false, "UTC"] # to_a shows Mar 2 t # => 2026-03-02 00:00:00 UTC # the to_a call appears to have normalized the object ``` The numeric constructor normalizes `Time.new(2026, 2, 30)` to March 2. A string with an offset other than Z (`+02:00`) also normalizes: ```ruby require "time" Time.new("2026-02-30T00:00:00+02:00") # => 2026-03-02 00:00:00 +0200 ``` This has been the behavior since at least Ruby 3.3.0. However, since [commit `77d0d22b`](https://github.com/ruby/ruby/commit/77d0d22b59e175a3f5ad64e53c0eaa7aa11eafcd) (2026-06-22), `Time.iso8601`, `Time.rfc3339`, and `Time.xmlschema` all parse by calling `Time.new(string)` instead of building from `Time.utc(y, m, d, ...)`. So they now inherit this behavior: ```ruby require "time" Time.iso8601("2026-02-30T00:00:00.000000000Z").iso8601(9) # => "2026-02-30T00:00:00.000000000Z" ``` Currently the test suite has a test that raises ArgumentError for an invalid month but we don't appear to have tests for invalid days. I think we should add a test for this case and fix Time.new(string) to normalize consistently. -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:125979] [Ruby Bug#22188] Debug symbols missing when compiled with GCC LTO
by rwstauner (Randy Stauner) 22 Sep '26

22 Sep '26
Issue #22188 has been reported by rwstauner (Randy Stauner). ---------------------------------------- Bug #22188: Debug symbols missing when compiled with GCC LTO https://bugs.ruby-lang.org/issues/22188 * Author: rwstauner (Randy Stauner) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- When compiling with LTO (the XCFLAGS and XLDFLAGS below) RUBY_CRASH_REPORT does not resolve symbols. ( export optflags="-O3" cflags="-fno-omit-frame-pointer" export XCFLAGS="-flto=auto -ffat-lto-objects -Werror=lto-type-mismatch" export XLDFLAGS="-flto=auto -ffat-lto-objects" ./configure --disable-install-doc --disable-shared make -j miniruby ) Simple crash simulation: ./miniruby -e 'Process.kill("SEGV", $$)' On master the output includes: -- C level backtrace information ------------------------------------------- /src/miniruby(0x5608c71bafdd) [0x5608c71bafdd] /src/miniruby(0x5608c71c6f46) [0x5608c71c6f46] /src/miniruby(0x5608c6f31370) [0x5608c6f31370] /src/miniruby(0x5608c70e3150) [0x5608c70e3150] /usr/lib/libc.so.6(0x7f62122ac2d0) [0x7f62122ac2d0] /usr/lib/libc.so.6(kill+0xb) [0x7f62122ac4db] /src/miniruby(0x5608c70e1a65) [0x5608c70e1a65] /src/miniruby(0x5608c7189d1e) [0x5608c7189d1e] /src/miniruby(0x5608c718dea7) [0x5608c718dea7] /src/miniruby(0x5608c719417e) [0x5608c719417e] /src/miniruby(0x5608c71b793c) [0x5608c71b793c] /src/miniruby(0x5608c6f3d13c) [0x5608c6f3d13c] /src/miniruby(0x5608c6f42321) [0x5608c6f42321] /src/miniruby(0x5608c6e4f9b3) [0x5608c6e4f9b3] /usr/lib/libc.so.6(0x7f62122956c1) [0x7f62122956c1] /usr/lib/libc.so.6(__libc_start_main+0x89) [0x7f62122957f9] [0x5608c6e4f9f5] With a tiny change to fall back to symtab (even after parsing DWARF) we can get (empty lines added for comparison with next block): -- C level backtrace information ------------------------------------------- /src/miniruby(rb_print_backtrace+0x1d) [0x55f6397aafdd] /src/vm_dump.c:1111 /src/miniruby(rb_vm_bugreport+0xa26) [0x55f6397b6f46] /src/vm_dump.c:1473 /src/miniruby(rb_bug_for_fatal_signal+0x110) [0x55f639521370] /src/error.c:1140 /src/miniruby(sigsegv+0x50) [0x55f6396d3150] /src/signal.c:948 /usr/lib/libc.so.6(0x7f991555d2d0) [0x7f991555d2d0] /usr/lib/libc.so.6(kill+0xb) [0x7f991555d4db] /src/miniruby(rb_f_kill+0x205) [0x55f6396d1a65] /src/signal.c:487 /src/miniruby(vm_call_cfunc_with_frame_+0xfe) [0x55f639779d1e] /src/vm_insnhelper.c:3821 /src/miniruby(vm_sendish.constprop.0+0xb7) [0x55f63977dea7] /src/vm_insnhelper.c:6056 /src/miniruby(vm_exec_core.lto_priv.0+0x6e) [0x55f63978417e] /src/insns.def:909 /src/miniruby(rb_vm_exec+0xec) [0x55f6397a793c] /src/vm.c:2825 /src/miniruby(rb_ec_exec_node+0xac) [0x55f63952d13c] /src/eval.c:284 /src/miniruby(ruby_run_node+0x61) [0x55f639532321] /src/eval.c:322 /src/miniruby(main+0x63) [0x55f63943f9b3] ./main.c:42 PR: https://github.com/ruby/ruby/pull/17743 Currently the code in addr2line.c has a stub: case DW_FORM_ref_addr: goto finish; /* not supported yet */ If we add support for that we can get better names and inlined frames (empty lines added for comparison with previous block): -- C level backtrace information ------------------------------------------- /src/miniruby(rb_print_backtrace+0x1d) [0x55cd045f81dd] /src/vm_dump.c:1111 /src/miniruby(fprintf+0x0) [0x55cd04604146] /src/vm_dump.c:1473 /src/miniruby(rb_vm_bugreport) /src/vm_dump.c:1476 /src/miniruby(rb_bug_for_fatal_signal+0x110) [0x55cd0436e370] /src/error.c:1140 /src/miniruby(sigsegv+0x50) [0x55cd04520150] /src/signal.c:948 /usr/lib/libc.so.6(0x7f9ef85522d0) [0x7f9ef85522d0] /usr/lib/libc.so.6(kill+0xb) [0x7f9ef85524db] /src/miniruby(rb_f_kill+0x205) [0x55cd0451ea65] /src/signal.c:487 /src/miniruby(vm_call_cfunc_with_frame_+0xfe) [0x55cd045c6f1e] /src/vm_insnhelper.c:3821 /src/miniruby(vm_sendish+0xb7) [0x55cd045cb0a7] /src/vm_insnhelper.c:6056 /src/miniruby(vm_exec_core+0x6e) [0x55cd045d137e] /src/insns.def:909 /src/miniruby(vm_exec_loop+0x16) [0x55cd045f4b3c] /src/vm.c:2825 /src/miniruby(rb_vm_exec) /src/vm.c:2801 /src/miniruby(rb_ec_exec_node+0xac) [0x55cd0437a13c] /src/eval.c:284 /src/miniruby(ruby_run_node+0x61) [0x55cd0437f321] /src/eval.c:322 /src/miniruby(rb_main+0x22) [0x55cd0428c9b3] ./main.c:42 /src/miniruby(main) ./main.c:62 /usr/lib/libc.so.6(0x7f9ef853b6c1) [0x7f9ef853b6c1] /usr/lib/libc.so.6(__libc_start_main+0x89) [0x7f9ef853b7f9] /src/miniruby(_start+0x25) [0x55cd0428c9f5] ./main.c:63 PR: https://github.com/ruby/ruby/pull/17744 -- https://bugs.ruby-lang.org/
3 4
0 0
[ruby-core:125491] [Ruby Feature#22068] Adding post-quantum cryptography (PQC) support across Ruby standard libraries
by jaruga (Jun Aruga) 21 Sep '26

21 Sep '26
Issue #22068 has been reported by jaruga (Jun Aruga). ---------------------------------------- Feature #22068: Adding post-quantum cryptography (PQC) support across Ruby standard libraries https://bugs.ruby-lang.org/issues/22068 * Author: jaruga (Jun Aruga) * Status: Open ---------------------------------------- ## Summary and motivation Post-quantum cryptography (PQC) means cryptography algorithm which people can safely use after (post) quantum computing is practically used in the future. By using the quantum computing which is much more powerful than the current computing, it can be possible to crack the current non-PQC algorithms. The goal of this ticket is to make Ruby (including libraries: default gems + bundle gems) work in the environment where only post-quantum cryptography (PQC)-supported algorithms are enabled, and other cryptography algorithms such as RSA are disabled. PQC-supported algorithms are only ML-DSA, ML-KEM and SLH-DSA for now. ML-DSA is used for signature (certification), and ML-KEM is used for connection. As I heard from my colleagues working for OpenSSL, that SLH-DSA is not ready to be used, we can ignore SLH-DSA for now. Ruby OpenSSL (ruby/openssl) already supports PQC by the ticket [ruby/openssl#894][ruby-openssl-pqc-issue]. And there are some works are needed for other standard libraries using Ruby OpenSSL in Ruby to support PQC. I cite the following text from the [NIST][nist-wikipedia]'s [PQC document][nist-pqc]. NIST is an organization deciding cryptography specifications in my understanding. > Some engineers even predict that within the next twenty or so years sufficiently large quantum computers will be built to break essentially all public key schemes currently in use. Historically, it has taken almost two decades to deploy our modern public key cryptography infrastructure. Therefore, regardless of whether we can estimate the exact time of the arrival of the quantum computing era, we must begin now to prepare our information security systems to be able to resist quantum computing. I also cite the following text from DigiCert, a security company's blog. ([link][digicert-blog-google-mtc]) > Gartner predicts that by 2029, conventional asymmetric cryptography like RSA and ECC will be unsafe for protecting sensitive data due to “harvest-now, decrypt-later" threats—even before a quantum break occurs. So, it's better to prepare PQC support now. As an example of the actual movement European Commission is trying to migrate from non-PQC to PQC.([link][ec-pqc]) ## Proof of concept I manage my proof-of-concept scripts on my [junaruga/ruby-pqc-test] repository. For now, there are only some scripts to test RubyGems and Bundler in PQC use cases. ## Tasks I checked ruby/ruby including default gems and bundled gems at the master branch commit `93f1010f70a3ac924c3b37e4ae82cf1a669fcbf0` which was the latest at that time. While ruby/ruby original code doesn't have PQC logic, the following libraries that have the own upstream project need to be modified to support PQC use cases in my investigation. And I am motivated to work on these tasks, adding the PQC features and/or tests. I will open the issue ticket for each upstream project ruby/* one by one. * [ruby/rubygems](https://github.com/ruby/rubygems) - Add PQC features * [ruby/rubygems bundler](https://github.com/ruby/rubygems/tree/master/bundler) - Add PQC features * [ruby/net-http](https://github.com/ruby/net-http) - default gem - Update code comments and add PQC tests * [ruby/open-uri](https://github.com/ruby/open-uri) - default gem - Add PQC tests * [ruby/spec](https://github.com/ruby/spec) - spec/ - Add PQC tests * [ruby/drb](https://github.com/ruby/drb): bundled gem - Add PQC features * [ruby/rbs](https://github.com/ruby/rbs): bundled gem - Not sure. There is `stdlib/openssl/0/openssl.rbs`. Note I used the following [ripgrep]'s `rg` command (an enhanced `grep` command) to check the affected files by PQC. ``` $ rg "require +['\"]openssl['\"]|OpenSSL" --type ruby ``` Please let me know what you think. [openssl-35-release]: https://openssl-library.org/post/2025-04-08-openssl-35-final-release/ [ruby-openssl-pqc-issue]: https://github.com/ruby/openssl/issues/894 [nist-wikipedia]: https://en.wikipedia.org/wiki/National_Institute_of_Standards_and_Technology [nist-pqc]: https://csrc.nist.gov/projects/post-quantum-cryptography [ec-pqc]: https://digital-strategy.ec.europa.eu/en/library/coordinated-implementation… [digicert-blog-google-mtc]: https://www.digicert.com/blog/google-merkle-tree-certificates [junaruga/ruby-pqc-test]: https://github.com/junaruga/ruby-pqc-test [ripgrep]: https://github.com/BurntSushi/ripgrep -- https://bugs.ruby-lang.org/
2 6
0 0
[ruby-core:126819] [Ruby Feature#18401] Rework `require_relative` to add the "current path" on `$LOAD_PATH`
by nobu (Nobuyoshi Nakada) 21 Sep '26

21 Sep '26
Issue #18401 has been updated by nobu (Nobuyoshi Nakada). Status changed from Open to Feedback vo.x (Vit Ondruch) wrote: > My proposal is to change the `require_relative` in following way: > > ~~~ > $LOAD_PATH.unshift __dir__ > require "foo" > ~~~ Do you mean `require_relative` should load the file in the current working directory? I don't think it is reasonable behavior. `require_relative` binds the caller's location more tightly, and should not be affected by the runtime environment. > In essence, non of the `require_relative`, `require`, `__FILE__` or `__dir__` would need to use real path. The scenario bellow would provide expected output: > > ~~~ > $ mkdir a > $ mkdir b > $ echo 'puts __dir__' > a/test.rb > $ cd b > $ ln -s ../a/test.rb test.rb > $ ruby test.rb > /home/vondruch/ruby/a > ~~~ Isn't this the same as the current behavior? ---------------------------------------- Feature #18401: Rework `require_relative` to add the "current path" on `$LOAD_PATH` https://bugs.ruby-lang.org/issues/18401#change-119130 * Author: vo.x (Vit Ondruch) * Status: Feedback ---------------------------------------- I think that since inception of `require_relative`, the implementation is wrong and is going against the spirit of `require` functionality. Let me explain. If there is `require "foo"`, it does something like: ~~~ r = $LOAD_PATH.select {|lp| File.exist? File.join(lp, "foo")}.first load(r) ~~~ But `require_relative "foo"` does something different: ~~~ r = File.join(File.realpath(__dir__), "foo") load(r) ~~~ Please note that this is problematic if mixture of `require` and `require_relative` (not mentioning `__FILE__` and `__dir__` are used. The major difference is actually the `File.realpath` here, because it expands symlinks and that is difference to `require` and may allow double loading. My proposal is to change the `require_relative` in following way: ~~~ $LOAD_PATH.unshift __dir__ require "foo" ~~~ In essence, non of the `require_relative`, `require`, `__FILE__` or `__dir__` would need to use real path. The scenario bellow would provide expected output: ~~~ $ mkdir a $ mkdir b $ echo 'puts __dir__' > a/test.rb $ cd b $ ln -s ../a/test.rb test.rb $ ruby test.rb /home/vondruch/ruby/a ~~~ This would also resolve issues such as #16978, #10222 or #17885 -- https://bugs.ruby-lang.org/
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • ...
  • 18
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.