Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError object does not get properly inspected on Java 21 #8539

Open
headius opened this issue Dec 20, 2024 · 1 comment
Open

NameError object does not get properly inspected on Java 21 #8539

headius opened this issue Dec 20, 2024 · 1 comment

Comments

@headius
Copy link
Member

headius commented Dec 20, 2024

This is a really weird one...

While working on a backport for the new inspect-free NameError logic (#8538) I had some trouble getting the issues in #8384 to reproduce on Java 21. It reproduced fine on Java 8.

Debugging through code and setting some breakpoints, I was unable to determine why it did not call the memory-exploding inspect on the NameError object. Instead, it seemed to fall back on the basic inspect logic that just prints the name of the class and an ID for the object:

$ jruby blah.rb
generating large obj
done
NameError: undefined local variable or method `nameerror' for #<Test:0x2a04ab05>
   error at blah.rb:9
  <main> at blah.rb:16

I need to investigate this to understand why a different path was taken on Java 21.

@headius headius added this to the JRuby 9.4.10.0 milestone Dec 20, 2024
@headius
Copy link
Member Author

headius commented Dec 20, 2024

#8538 (comment)

@enebo That is good information... I suspect you are right and for whatever reason an override of inspect is not getting called on 21. Your context changes likely fixed that so all paths use the same one.

Interestingly this is a version of the bug I suggested we might see from adding new methods to IRubyObject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant