-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
NoMethodError being reported as "UndefinedValue.java:52:in `undefinedOperation': java.lang.RuntimeException: IR compiler/interpreter bug: org.jruby.ir.operands” in jruby-9.0.0.0.pre2 #3094
Comments
@DougEverly Could you try this against rc1 as well to make sure it hasn't been fixed since pre2? If it is still a problem then we would like to get some more information on what is causing this. Your report mentions you are expecting NoMethodError but since we probably have hundreds of tests passing for NoMethodError cases I am guessing something more is at play (which is obviously not in any test suites we run). The error itself is us forcing a hard error because this case should never happen. The proverbial pooch is so screwed at that point we cannot try and recover so we dump a hard error. |
I changed to jruby 9.0.0.0.rc1 and still got this, even after removing what I thought was the bad line. Not sure how to pinpoint the Ruby code leading to this error.
|
@DougEverly Thanks for checking so quickly. If you could dig a little bit I have a command-line for you:
This will generate a heinous amount of output but it will make it possible to see what is blowing up (with a trained eye). Go to bottom of output file and search up to first occurrence of 'java.lang.RuntimeException: IR" and you should see an IR Instruction around there with UndefinedValue (I think it is printed out as %undefined). scrolling up a little ways from this area you should see a line marking whch code is being passed over. Line which sort of looks like this:
This shows the file (super_block1.rb), line (22), scope type (a block - IRClosure), and compiler pass. You really don't need to know all that much about what this output means to find the general area. If you are not worried about privacy of the code you are running you can just upload this to a gist and I can look at it. |
If you can provide a way for us to reproduce this, it would also help a lot (and probably wouldn't take long to track down such a complete failure). |
Unfortunately, I am unable to reproduce the problem now. I likely removed or avoided the condition somehow, and the code is running as expected. If it arises again, I’ll take better care to get a reproducible sample. |
@DougEverly Thanks for giving it a go! |
I am able to reproduce the same error as above by upgrading my rails app from 1.7.24 to 9.0.5.0 and running
See full stack trace: When I run https://gist.github.com/atambo/812ac801f7f94ed94afb If you need more of the file or the whole thing let me know and I can upload it somewhere. |
@atambo Ok thanks. I'll try to reproduce here based on that. |
I'm still unable to reproduce this, but I suspect that it's a bug in the full interpreter. @atambo If you can still reproduce this, try adding @enebo @subbuss Without a repro this is hard to find, but it may get fixed if we get our test runs passing with the full interpreter turned on. |
@atambo Also a separate backtrace with |
Here is the stacktrace when I run https://gist.github.com/atambo/5c7704d226e638e35614 Would you like the output with |
@atambo The IR output would be helpful if we can get a complete file. Feel free to email me a zip or something. And I guess I'll need you to pass |
Here is the output of https://gist.github.com/atambo/73f47b5f39831b13b7ec Here is the output of |
Ok, we're narrowing it down. It looks like the file that triggers it is I'm going to add some better logging to this error so we can see exactly what body of code (and possibly what instruction) it's failing on. |
Dug a bit deeper...now I'm into the file |
Ok, @atambo stopped by IRC and let me see def foo(n = n)
p n
end
foo Run in JRuby:
So this circular variable form is being parsed or compiled incorrectly. Here's parser output:
And here's relevant
So we both appear to parse it as an optional var being assigned itself. This should have been a warning in @atambo's code, I think. It comes down to IR; here's the IR for the above code:
And here we see the problem. Seems purely an IR problem, and it affects all tiers. |
Ok, I have a working patch that introduces another temporary variable for the intermediate "undefined" value from The new IR for the
Instructions 5 and 7 populate the temporary variable Worth pointing out that my patch also fixes optional block arguments, which had a similar problem. I'll be pushing this fix momentarily, but would appreciate review by @subbuss and @enebo. |
When I call a nonexistent method on an object, I get this in ruby 1.7.19:
NoMethodError: undefined method
stop_responder' for #SharedRPCClient:0x7237dd8c`However, same code using jruby-9.0.0.0.pre2, i get this non-helpful (from a ruby perspective) java output:
The text was updated successfully, but these errors were encountered: