JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6101

JSR 223 code execution breaks with JRuby 1.6.4/1.6.3 with no error message

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.3, JRuby 1.6.4
    • Fix Version/s: JRuby 1.6.5, JRuby 1.7.0.pre1
    • Component/s: Embedding
    • Labels:
      None
    • Environment:
      Java Version: 1.6.0_27 /Win7 64-bit
    • Number of attachments :
      0

      Description

      Hi,
      I use the ScriptEngineManager to execute Ruby Scripts from Java Code, but with JRuby 1.6.4 the following code breaks:

      for (; ; ) {
            ScriptEngineManager m = new ScriptEngineManager();
            m.getEngineByExtension("rb").eval("puts(\""+new Date()+"\")");
          }
      

      The loop stops with no error message after about 20 outputs. If I use the same code with JRuby 1.5.6 everything works fine.

      BTW: If I do the Script Engine initialization outside the loop it works (but thats not the way I should have to do it - no other ScriptEngine implementation has a problem with the kind of initialization shown above).

      Add. info from the mailing list:

      Thanks for reporting this. I confirmed exactly the same weird behavior
      on master, too. This doesn't happen on ScriptingContainer, so is a
      JSR223 impl bug probably. I'm going to look into this bug.

      Would you file this in JIRA? You can track a bug fixing.

      -Yoko

        Activity

        Hide
        Yoko Harada added a comment -

        I see.

        I'm now thinking about how JSR223 impl can avoid this problem. There should be a way.
        When I change the code, I'll add comment here. So, keep watching this issue.

        Show
        Yoko Harada added a comment - I see. I'm now thinking about how JSR223 impl can avoid this problem. There should be a way. When I change the code, I'll add comment here. So, keep watching this issue.
        Hide
        Yoko Harada added a comment -

        I pushed the change in rev. 0ad4313 on jruby-1_6 and 386b82e on master branches.

        Would you try the latest version out?

        Show
        Yoko Harada added a comment - I pushed the change in rev. 0ad4313 on jruby-1_6 and 386b82e on master branches. Would you try the latest version out?
        Hide
        j freund added a comment - - edited

        It looks pretty good. I'm not able to reproduce the exception on win7 and open suse (vm)!!!
        thx!!!

        Show
        j freund added a comment - - edited It looks pretty good. I'm not able to reproduce the exception on win7 and open suse (vm)!!! thx!!!
        Hide
        Yoko Harada added a comment -

        Thanks for confirming.

        I added a new class to bypass the problematic area. This fix works as long as a user doesn't use javax.script.SimpleScriptContext. The existence of SimpleBindings/SimpleScriptContext brings a lot of problem to JRuby Engine.

        I'm going resolve this issue.

        Show
        Yoko Harada added a comment - Thanks for confirming. I added a new class to bypass the problematic area. This fix works as long as a user doesn't use javax.script.SimpleScriptContext. The existence of SimpleBindings/SimpleScriptContext brings a lot of problem to JRuby Engine. I'm going resolve this issue.
        Hide
        Yoko Harada added a comment -

        The bug fix was confirmed by the reporter.

        Show
        Yoko Harada added a comment - The bug fix was confirmed by the reporter.

          People

          • Assignee:
            Yoko Harada
            Reporter:
            j freund
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: