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

Context.if_enabled fails with AssertionError in interactive mode #6227

Closed
4e6 opened this issue Apr 7, 2023 · 0 comments · Fixed by #6246
Closed

Context.if_enabled fails with AssertionError in interactive mode #6227

4e6 opened this issue Apr 7, 2023 · 0 comments · Fixed by #6246
Assignees
Labels
--bug Type: bug -compiler p-high Should be completed in the next sprint

Comments

@4e6
Copy link
Contributor

4e6 commented Apr 7, 2023

Related #6129

The program below fails in interactive mode

from Standard.Base import all
from Standard.Base.Runtime.Context import Output

main =
    res = Output.if_enabled 42
    res

The expression Oubtput.if_enabled 42 should have an id assigned to be a subject of instrumentation. For a repro, see examples in the RuntimeExecutionEnvironmentTest suite.

java.lang.AssertionError: Invariant contract violation for receiver Error Output(org.enso.interpreter.runtime.callable.atom.unboxing.Layout_Atom_0_1) and identifier to_display_text.
	at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.invokeMember(InteropLibrary.java:3462)
	at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$UncachedDispatch.invokeMember(InteropLibraryGen.java:7066)
	at org.enso.interpreter.service.ExecutionService.getExceptionMessage(ExecutionService.java:443)
	at org.enso.interpreter.instrument.job.ProgramExecutionSupport$.sendExpressionUpdate(ProgramExecutionSupport.scala:341)
	at org.enso.interpreter.instrument.job.ProgramExecutionSupport$.$anonfun$executeProgram$3(ProgramExecutionSupport.scala:74)
	at org.enso.interpreter.instrument.IdExecutionInstrument$IdExecutionEventNode.passExpressionValueToCallback(IdExecutionInstrument.java:301)
	at org.enso.interpreter.instrument.IdExecutionInstrument$IdExecutionEventNode.onExpressionReturn(IdExecutionInstrument.java:278)
	at org.enso.interpreter.instrument.IdExecutionInstrument$IdExecutionEventNode.onReturnValue(IdExecutionInstrument.java:237)
	at org.enso.interpreter.instrument.IdExecutionInstrument$IdExecutionEventNode.onReturnExceptional(IdExecutionInstrument.java:247)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnReturnExceptional(ProbeNode.java:1387)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onReturnExceptional(ProbeNode.java:1023)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode.onReturnExceptionalOrUnwind(ProbeNode.java:288)
	at org.enso.interpreter.node.ExpressionNodeWrapper.executeGeneric(ExpressionNodeWrapper.java:119)
	at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:57)
	at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:36)
	at org.enso.interpreter.node.scope.AssignmentNodeGen.executeVoid(AssignmentNodeGen.java:75)
	at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
	at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:56)
	at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:709)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:632)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:565)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:549)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:495)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
	at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:56)
	at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:90)
	at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:52)
	at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:49)
	at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:157)
	at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
	at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:92)
	at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:102)
	at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:58)
	at org.enso.interpreter.node.callable.InteropApplicationNode.callCached(InteropApplicationNode.java:79)
	at org.enso.interpreter.node.callable.InteropApplicationNodeGen.executeAndSpecialize(InteropApplicationNodeGen.java:95)
	at org.enso.interpreter.node.callable.InteropApplicationNodeGen.execute(InteropApplicationNodeGen.java:56)
	at org.enso.interpreter.node.callable.FunctionCallInstrumentationNode$FunctionCall$Execute.callCached(FunctionCallInstrumentationNode.java:103)
	at org.enso.interpreter.node.callable.FunctionCallGen$InteropLibraryExports$Cached.executeAndSpecialize(FunctionCallGen.java:91)
	at org.enso.interpreter.node.callable.FunctionCallGen$InteropLibraryExports$Cached.execute(FunctionCallGen.java:78)
	at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.execute(InteropLibrary.java:3034)
	at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.execute(InteropLibraryGen.java:7765)
	at org.enso.interpreter.service.ExecutionService$ExecuteRootNode.execute(ExecutionService.java:477)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:709)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:632)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:565)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:549)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:477)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:458)
	at org.enso.interpreter.service.ExecutionService.execute(ExecutionService.java:181)
	at org.enso.interpreter.service.ExecutionService.execute(ExecutionService.java:222)
	at org.enso.interpreter.instrument.job.ProgramExecutionSupport$.executeProgram(ProgramExecutionSupport.scala:106)
	at org.enso.interpreter.instrument.job.ProgramExecutionSupport$.$anonfun$runProgram$3(ProgramExecutionSupport.scala:215)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at cats.syntax.EitherObjectOps$.catchNonFatal$extension(either.scala:391)
	at org.enso.interpreter.instrument.job.ProgramExecutionSupport$.$anonfun$runProgram$2(ProgramExecutionSupport.scala:215)
	at scala.util.Either.flatMap(Either.scala:352)
	at org.enso.interpreter.instrument.job.ProgramExecutionSupport$.runProgram(ProgramExecutionSupport.scala:209)
	at org.enso.interpreter.instrument.job.ExecuteJob.run(ExecuteJob.scala:38)
	at org.enso.interpreter.instrument.job.ExecuteJob.run(ExecuteJob.scala:15)
	at org.enso.interpreter.instrument.execution.JobExecutionEngine.$anonfun$runInternal$1(JobExecutionEngine.scala:113)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotThread.access$001(PolyglotThread.java:53)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotThread$1.execute(PolyglotThread.java:100)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.executeImpl(PolyglotThread.java:134)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.execute(PolyglotThread.java:125)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:709)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:632)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:565)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:549)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:477)
	at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:458)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotThread.run(PolyglotThread.java:96)
Caused by: Attached Guest Language Frames (3)
@4e6 4e6 added --bug Type: bug -compiler labels Apr 7, 2023
@github-project-automation github-project-automation bot moved this to ❓New in Issues Board Apr 7, 2023
@jdunkerley jdunkerley added this to the Design Partners milestone Apr 11, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Apr 11, 2023
@hubertp hubertp added the p-high Should be completed in the next sprint label Apr 11, 2023
@mergify mergify bot closed this as completed in #6246 Apr 12, 2023
mergify bot pushed a commit that referenced this issue Apr 12, 2023
Added a missing `to_display_text` method which, by convention, is defined via a builtin method.

Also re-enabled and fixed pending tests.

Closes #6227.
@github-project-automation github-project-automation bot moved this from 📤 Backlog to 🟢 Accepted in Issues Board Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler p-high Should be completed in the next sprint
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants