Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8222205

java.lang.NullPointerException when using jjs with r.js

    Details

    • Subcomponent:
    • Introduced In Build:
      b25
    • Introduced In Version:
      10
    • CPU:
      x86
    • OS:
      os_x

      Description

      A DESCRIPTION OF THE PROBLEM :
      jdk11 jjs failed to run r.js file. It used to work well with jdk8 jjs.

      REGRESSION : Last worked in version 8u192

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. download "r.js" from https://github.com/requirejs/r.js/raw/master/dist/r.js
      2. create "test.config.js" with the following contents.
      ({
      baseUrl: '.',
      paths: {
      },
      name: 'test',
      out: './gen/test.js',
      optimize: "none",
      logLevel: 3
      })
      3. run "/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/jjs -scripting r.js -- -o test.config.js"

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      run without java.lang.NullPointerException
      ACTUAL -
      $ /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/jjs -scripting r.js -- -o test.config.js
      Warning: The jjs tool is planned to be removed from a future JDK release
      Exception in thread "main" java.lang.VerifyError: Code generation bug in "L:19#L:260#bind#L:382": likely stack misaligned: java.lang.NullPointerException r.js
      at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.CodeGenerator.leaveFunctionNode(CodeGenerator.java:2177)
      at jdk.scripting.nashorn/jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:405)
      at jdk.scripting.nashorn/jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
      at jdk.scripting.nashorn/jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:47)
      at jdk.scripting.nashorn/jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:57)
      at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.CompilationPhase.transformFunction(CompilationPhase.java:635)
      at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.CompilationPhase$BytecodeGenerationPhase.transform(CompilationPhase.java:424)
      at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.CompilationPhase.apply(CompilationPhase.java:631)
      at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:657)
      at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.CompiledFunction.handleRewriteException(CompiledFunction.java:847)
      at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.CompiledFunction.handleRewriteException(CompiledFunction.java:739)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$173$11070AA$r.L:19#L:260#each(r.js:308)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$158$52246$r.L:19#L:260#newContext#enable(r.js:1362)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$228$70685A$r.L:19#L:260#newContext#enable-1(r.js:1806)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$225$52732AI$r.L:19#L:260#newContext#enable#L:1362(r.js:1410)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$300$13437AIA$r.L:19#L:260#bind#L:382(r.js:383)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$173$11070AA$r.L:19#L:260#each(r.js:308)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$158$52246$r.L:19#L:260#newContext#enable(r.js:1362)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$152$36667AAAA$r.L:19#L:260#newContext#init(r.js:1037)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$150$66307$r.L:19#L:260#newContext#makeRequire#localRequire#L:1698(r.js:1709)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$115$81521A$r.L:19#L:260#L:2065(r.js:2065)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$112$64189AAA$r.L:19#L:260#newContext#makeRequire#localRequire(r.js:1698)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$189$79976AAAA$r$cu1$restOf.L:19#L:260#requirejs(r.js:2046)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$176$728AAA$r$cu1$restOf.:scopeCall-41(r.js)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$176$728AAA$r$cu1$restOf.L:19(r.js:30371)
      at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$84$r$cu1$restOf.:program(r.js:30429)
      at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
      at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
      at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
      at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.apply(Shell.java:522)
      at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.runScripts(Shell.java:451)
      at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.run(Shell.java:189)
      at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:105)
      at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:81)
      Caused by: java.lang.NullPointerException
      at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.CodeGenerator.generateContinuationHandler(CodeGenerator.java:5431)
      at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.CodeGenerator.leaveFunctionNode(CodeGenerator.java:2159)
      ... 33 more


      FREQUENCY : always


        Attachments

        1. test.config.js
          0.1 kB
        2. r.js
          1.13 MB

          Issue Links

            Activity

              People

              • Assignee:
                hannesw Hannes Wallnoefer
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: