Project

General

Profile

Actions

Bug #21992

closed

Defining BasicObject#initialize causes segmentation fault

Bug #21992: Defining BasicObject#initialize causes segmentation fault

Added by petercooper (Peter Cooper) 2 days ago. Updated about 14 hours ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:125237]

Description

Simplest reproduction:

class BasicObject
  def initialize
  end
end

In Ruby HEAD, 4.0.2, 3.4.7, and 3.3.11 on macOS, this leads to an immediate segmentation fault. I also got this on Ruby 3.4.1 on Linux.

What I would expect, a warning similar to that raised if you do the same on Object.

I couldn't find a previous mention of this. It's not something you would ever write yourself, but I guess it could arise during metaprogramming or dynamic code generation with the right (wrong) constant name in play.


Related issues 1 (0 open1 closed)

Related to Ruby - Bug #21694: Crash when looking up super method from BasicObjectClosedActions
Actions

Also available in: PDF Atom