-
-
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
Kernel.load(file, true) produces RuntimeException: Should not get here! #3180
Comments
Yeah. Perhaps at some point we regressed on 1.7? At some point we had some large internal changes to LoadService. Crash in 9k is an IR issue but could be directly supported to us not properly supporting wrap. |
That's what I had imagined, but see above: my test also fails on jruby 1.7.0. In latest commit test-load-wrap I improved my test a bit. Same results. |
@dekellum haha...very odd. |
Current results on 1.7 branch:
I'll have a look. |
I think I have a patch that fixes wrapping. |
Part of work for 1.7 load(..., true) for #3180.
Ok, I've patched this in 1.7 and it seems ok. Both interpreter and AOT scenarios properly isolate definitions when wrap = true. I'm looking into 9k now, and the error is a bit different:
|
Ok, looks like a hack I put in place while trying to get block call protocol working in JIT was left in, and causes the above error. Removing that hack gets me back to the "should not get here" error. I'll investigate from there. |
This is part of work for #3180. This appears to fix issues with load(..., true) not actually wrapping method definitions in an anonymous module.
Ok, I think this is working properly on master too now. There were specs on master we did not pass that pass now, so I'm going to call this fixed and close it. @dekellum If you get a chance, verify jruby-1_7 branch and master builds (or grab tomorrow from http://ci.jruby.org) and let us know that things are fixed for you! |
Since it fails hard (raises) on these versions. See jruby/jruby#3180
I can confirm that the 1.7.24-SNAPSHOT (2016-01-18T05:10:56.000Z) is now working fine. The 9.0.5.0-SNAPSHOT (2016-01-18T05:38:12.000Z) is working for the simple test provided above but is failing in a new way in my more complex application (syncwrap, a method included at top-level is no longer found.) I'll try to expand the above simple test to reproduce this, and report back. |
This is more analogous to the usage in the Syncwrap project. cc: jruby/jruby#3180
I updated the test here: dekellum/test-load-wrap@44d50f9 to include this case that still fails on jruby 9.0.5.0-SNAPSHOT, as shown in the last case below. As I can't reopen this issue, I'll wait for a response before opening any new issue. Thanks.
|
* jruby-1_7: (27 commits) Update jnr-posix to finally fix 32 bit JVM crasher on windows stat pend marshaling behavior - not working for Java non-member classes (GH-3526) local (non-member) classes should have correct name just like anonymous classes DRY out getClassFromPath usage in UnmarshalStream (all delegating to one method) review runtime's getClassFromPath hide unmarshalObject methods that use private inner type as a parameter Update for newer jnr-posix for windows 32 bit JVM stat workaround Remove remaining `should` uses from compiler specs. Don't deoptimize while loops just because of a block arg. Always assign masgn destructured args in block as block-local. Move parser scripts to tool. Add case for breakage fixed in b93fbb6e431. Check for empty identifiers and treat them as false. Same fix for AOT as for interp for #3180. Also use the anonymous wrap class for pushRubyClass, for defs. More robust, less breaky fix to omit bad class/package elements. Revert "Use methods instead of procs for converters." Fixes #3550. Warning "io/console not supported; tty will not be manipulated" occurs again on 1.7.23 updating to jcodings messes with this obscure char no longer being considered a space. Update to latest jcodings ...
Oops, catching up...I guess we did fix this in response to #3609. |
Jruby, hasn't had support for the wrap=true option of Kernel::load. While previously (1.6.8, 1.7.0, 1.7.16, 1.7.21) it would not honor this option, it now (9.0.0.0) produces a runtime exception
java.lang.RuntimeException: Should not get here! scopeType is SCRIPT_BODY
if the wrap option is set.There was previously a JRUBY-4339 on codehaus:
http://ruby.11.x6.nabble.com/jira-Created-JRUBY-4339-Kernel-load-with-wrap-true-does-not-protect-the-global-namespace-of-calling-m-td3480038.html
The jruby 1.7.0 release notes suggest this was fixed?
http://jruby.org/2012/10/22/jruby-1-7-0.html
...but my testing doesn't agree. Here is a minimal test setup:
https://github.com/dekellum/test-load-wrap
And here is output from MRI (passing); jruby 1.7.0, 1.7.16, 1.7.21 (shows not honoring wrap); and jruby 9.0.0.0 (new RuntimeException raised). For prior 9.x pre-releases I believe #3126 was preventing me from getting this far to see this issue.
The text was updated successfully, but these errors were encountered: