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
Doing require_relative too often leads to TypeError #4482
Comments
@janlelis two things. Can you figure out if it always happens at a particular number (e.g. 20)? Also do you have any JRUBY_OPTS set. I am not seeing this but I am using MacOS so perhaps there is a platform difference? |
I forgot about it, indeed, I have JRUBY_OPTS set to It seems to usually fail between the 50th - 100th call. I also noticed, after rescueing the TypeError, subsequent calls to With this test script as
I get the following output
|
Definitely a JIT+indy bug. I have no clue at the moment. |
Can confirm. Had an old hackish script to load all dependent source files from a sub-directory (about 120 of them) using the following code. It would error at seemingly random points in the execution, sometimes failing a little before halfway, sometimes failing right before the end. There does not seem to be a pattern to it. It was definitely running with Example Code# invoked from project root, so use .. to coerce back into real path
Dir.glob('subfolder/*.rb').each {|file| require_relative("../#{file}") } I do not recall if adding a |
Separate varargs and specific-arity names in JIT. Fixes #4482
Environment
jruby 9.1.8.0-SNAPSHOT (2.3.1) 2017-02-06 3f97c7a Java HotSpot(TM) 64-Bit Server VM 25.111-b14 on 1.8.0_111-b14 +indy +jit [linux-x86_64]
Linux ok 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Setup
Empty file:
a.rb
Contents of
b.rb
, in the same directory:Expected Behavior
Actual Behavior
Works find for a smaller iteration count, for example, 4.
The text was updated successfully, but these errors were encountered: