Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Nov 15, 2025

It's better not to create method object unnecessarily.

Found by this bug report: https://bugs.ruby-lang.org/issues/21673
Segfaults at KERNEL_PUBLIC_METHOD.bind_call(main, command) in context.rb:636

# Step 1
irb(main):001* module Foo
irb(main):002*   refine Kernel do
irb(main):003*      def puts; end
irb(main):004*   end
irb(main):005> end
=> #<refinement:Kernel@Foo>
# Step 2: Type "puts"
irb(main):006> put/path/to/lib/irb/context.rb:636: [BUG] Segmentation fault at 0x0000000000000030
...

@st0012 st0012 added the bug Something isn't working label Nov 15, 2025
@tompng tompng merged commit 6693ffa into ruby:master Nov 15, 2025
29 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants