Project

General

Profile

Actions

Bug #19065

closed

ruby 3.1.2 is printing all class variables for undefined error

Added by Varun (Sai Varun) over 1 year ago. Updated over 1 year ago.

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

Description

Not sure whether this is a bug or some config issue from my side


Files

checking_rb2.png (20.6 KB) checking_rb2.png error Varun (Sai Varun), 10/17/2022 06:52 AM
checking_rb1.png (19.5 KB) checking_rb1.png Code Varun (Sai Varun), 10/17/2022 06:52 AM

Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Feature #18285: NoMethodError#message uses a lot of CPU/is really expensive to callClosedActions

Updated by mame (Yusuke Endoh) over 1 year ago

  • Status changed from Open to Feedback

We need how to reproduce the issue and error output at least.

Updated by Varun (Sai Varun) over 1 year ago

My bad

I have used the command "ruby script"
In the error message, we are getting all the class variables printed

We load a few files into the class variables and this issue is causing a bit of trouble for us.
Please check it once

Actions #3

Updated by mame (Yusuke Endoh) over 1 year ago

  • Is duplicate of Feature #18285: NoMethodError#message uses a lot of CPU/is really expensive to call added

Updated by mame (Yusuke Endoh) over 1 year ago

  • Status changed from Feedback to Closed

I think this is a duplicate of #18285.

Since Ruby 3.0.0, an error message of UndefinedMethod always includes all instance variables. As this could be too long as you said, it is reconsidered in #18285.

$ ./bin/ruby-2.7.6 -e 'class Foo; def initialize; @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1; end; end; Foo.new.boo'
Traceback (most recent call last):
-e:1:in `<main>': undefined method `boo' for #<Foo:0x000055f12b8e94b0> (NoMethodError)

$ ./bin/ruby-3.0.0 -e 'class Foo; def initialize; @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1; end; end; Foo.new.boo'
-e:1:in `<main>': undefined method `boo' for #<Foo:0x0000559d6e0b5de0 @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1> (NoMethodError)

Updated by Varun (Sai Varun) over 1 year ago

Ok thanks for the info

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0