The jruby interpreter seems to run forever. Even when I have removed everything from the ruby file except for this line, it still seems to not terminate when parsing this particular string.
Here's the stack trace of the non-terminating code when I've tried to dump the running thread:
"main@1" prio=5 tid=0x1 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at org.joni.ByteCodeMachine.matchAt(ByteCodeMachine.java:307)
at org.joni.Matcher.matchCheck(Matcher.java:304)
at org.joni.Matcher.searchInterruptible(Matcher.java:480)
at org.jruby.RubyRegexp$SearchMatchTask.run(RubyRegexp.java:268)
at org.jruby.RubyRegexp$SearchMatchTask.run(RubyRegexp.java:249)
at org.jruby.RubyThread.executeTask(RubyThread.java:1485)
at org.jruby.RubyRegexp.matcherSearch(RubyRegexp.java:232)
at org.jruby.lexer.LexingCommon.parseMagicComment(LexingCommon.java:835)
at org.jruby.lexer.yacc.RubyLexer.yylex(RubyLexer.java:877)
at org.jruby.lexer.yacc.RubyLexer.nextToken(RubyLexer.java:347)
at org.jruby.parser.RubyParser.yyparse(RubyParser.java:1617)
at org.jruby.parser.RubyParser.yyparse(RubyParser.java:1568)
at org.jruby.parser.RubyParser.parse(RubyParser.java:5365)
at org.jruby.parser.Parser.parse(Parser.java:128)
at org.jruby.parser.Parser.parse(Parser.java:105)
at org.jruby.Ruby.parseFileAndGetAST(Ruby.java:2677)
at org.jruby.Ruby.parseFileFromMainAndGetAST(Ruby.java:2670)
at org.jruby.Ruby.parseFileFromMain(Ruby.java:2658)
at org.jruby.Ruby.parseFromMain(Ruby.java:610)
at org.jruby.Ruby.runFromMain(Ruby.java:556)
at org.jruby.Main.doRunFromMain(Main.java:417)
at org.jruby.Main.internalRun(Main.java:305)
at org.jruby.Main.run(Main.java:232)
at org.jruby.Main.main(Main.java:204)
Hopefully that helps. 😉
Expected Behavior
MRI seems to parse this line properly and terminates immediately.
The text was updated successfully, but these errors were encountered:
@jsyeo thanks for reporting this. The lexer processes comment lines looking for magic comment pragmas and we use a regexp. I am guessing something about this string causes our regexp engine to behave pathologically. This definitely helps since it gives a realistic line where we choke.
Environment
My
ruby -v
says:And I am using OS X 10.12.6.
Actual Behavior
When reading a file that contains this comment:
The jruby interpreter seems to run forever. Even when I have removed everything from the ruby file except for this line, it still seems to not terminate when parsing this particular string.
Here's the stack trace of the non-terminating code when I've tried to dump the running thread:
Hopefully that helps.😉
Expected Behavior
MRI seems to parse this line properly and terminates immediately.
The text was updated successfully, but these errors were encountered: