Skip to content
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

java.lang.IllegalArgumentException: The frame slot '0' is not known by the frame descriptor. #14

Closed
ghost opened this issue Jun 8, 2018 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jun 8, 2018

The exception occurs in the following code, since rc2.
To reproduce it's essential to

  • create a new Context from the same Engine. When creating contexts with Context.create("js") (and a new engine is used each time) there's no error.
  • context must be closed after use; if not closed there's no error
  • javascript contains a const; for a var there's no error

The error occurs on the 2nd iteration.

import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Engine;

public class Bug {

  public static void main(String[] args) throws Exception {

    String snippet = "const x=1";

    Engine engine = Engine.create();
    Context context;

    for (int i = 0; i < 2; i++) {
      context = Context.newBuilder("js").engine(engine).build();
      context.eval("js", snippet);
      context.close();
      System.out.println("ok");
    }
  }
}

Result of running the class:

hans@ubuntu-desktop:~/graal$ java Bug
ok
Exception in thread "main" org.graalvm.polyglot.PolyglotException: java.lang.IllegalArgumentException: The frame slot '0' is not known by the frame descriptor.
at org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing.checkSlotIndex(FrameWithoutBoxing.java:297)
at org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing.verifySet(FrameWithoutBoxing.java:280)
at org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing.setObject(FrameWithoutBoxing.java:122)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNode.doObject(JSWriteFrameSlotNode.java:138)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.executeAndSpecialize(JSWriteScopeFrameSlotNodeGen.java:366)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.execute_generic3(JSWriteScopeFrameSlotNodeGen.java:195)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.execute(JSWriteScopeFrameSlotNodeGen.java:88)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.executeVoid(JSWriteScopeFrameSlotNodeGen.java:294)
at com.oracle.truffle.js.nodes.control.ExprBlockNode.execute(ExprBlockNode.java:68)
at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:66)
at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:139)
at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:92)
at :program(Unknown)
at org.graalvm.polyglot.Context.eval(Context.java:336)
at Bug.main(Bug.java:15)
Original Internal Error:
java.lang.IllegalArgumentException: The frame slot '0' is not known by the frame descriptor.
at org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing.checkSlotIndex(FrameWithoutBoxing.java:297)
at org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing.verifySet(FrameWithoutBoxing.java:280)
at org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing.setObject(FrameWithoutBoxing.java:122)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNode.doObject(JSWriteFrameSlotNode.java:138)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.executeAndSpecialize(JSWriteScopeFrameSlotNodeGen.java:366)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.execute_generic3(JSWriteScopeFrameSlotNodeGen.java:195)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.execute(JSWriteScopeFrameSlotNodeGen.java:88)
at com.oracle.truffle.js.nodes.access.JSWriteScopeFrameSlotNodeGen.executeVoid(JSWriteScopeFrameSlotNodeGen.java:294)
at com.oracle.truffle.js.nodes.control.ExprBlockNode.execute(ExprBlockNode.java:68)
at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:66)
at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:139)
at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:92)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:262)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:251)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:241)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:226)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:209)
at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:86)
at org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:70)
at com.oracle.truffle.js.parser.JavaScriptLanguage$1.execute(JavaScriptLanguage.java:211)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:262)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:251)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:241)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:226)
at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:202)
at com.oracle.truffle.api.vm.PolyglotContextImpl.eval(PolyglotContextImpl.java:746)
at org.graalvm.polyglot.Context.eval(Context.java:311)
at org.graalvm.polyglot.Context.eval(Context.java:336)
at Bug.main(Bug.java:15)
Caused by: Attached Guest Language Frames (2)

@woess woess self-assigned this Jun 11, 2018
@wirthi
Copy link
Member

wirthi commented Jun 12, 2018

Thanks for reporting, @hanzr.

@woess is already looking into the problem.

@woess woess added the bug Something isn't working label Jun 14, 2018
@woess
Copy link
Member

woess commented Jun 20, 2018

Thanks again for the bug report. The fix is now in master and will be released in rc3.

@woess woess closed this as completed Jun 20, 2018
graalvmbot pushed a commit that referenced this issue Sep 1, 2021
Original commit message:

    Merged: Squashed multiple commits.

    Merged: Prepare renaming "V8 Linux64 TSAN - concurrent marking" bot
    Revision: 165d8f5b5ab5ba6fa19acd7ae6b17aa1a1b18428

    Merged: [test] Remove entry of renamed builder
    Revision: 375579f940b96224b2c525a6133650b760a5d865

    NOTRY=true
    NOPRESUBMIT=true
    NOTREECHECKS=true
    [email protected]

    Change-Id: If7c8296c495d087c2e4dc6cde3512bc3f8a469fc
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2418098
    Reviewed-by: Michael Achenbach <[email protected]>
    Reviewed-by: Georg Neis <[email protected]>
    Commit-Queue: Michael Achenbach <[email protected]>
    Cr-Commit-Position: refs/branch-heads/8.6@{#14}
    Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1}
    Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472}

Refs: v8/v8@33f4064

PR-URL: nodejs/node#38275
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants