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

Debug.breakpoint is sometimes not seeing variables defined in the parent scope, nor ones defined within the REPL; only if IR caches are enabled #8405

Open
radeusgd opened this issue Nov 27, 2023 · 8 comments
Assignees
Labels
--bug Type: bug -compiler p-lowest Should be completed at some point

Comments

@radeusgd
Copy link
Member

radeusgd commented Nov 27, 2023

Latest status is described in this comment below.


I'm not exactly sure what circumstances are needed to trigger this exactly, but I know a deterministic repro that allows me to reproduce the scenario.

First, apply the following diff to the current develop and rebuild the engine+libs (buildEngineDistribution):

Index: distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso
--- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso	(revision 9b7e3d0f1623b9f336cbbfa12f0055c8cfaa531b)
+++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File_Format.enso	(date 1701100888899)
@@ -46,7 +46,13 @@
        Implements the `File.read` for this `File_Format`
     read : File -> Problem_Behavior -> Any ! File_Error
     read self file on_problems = if file.is_directory then file.list else
+        Standard.Base.IO.println file
+        Standard.Base.IO.println "exists? "+file.exists.to_text
         reader = Auto_Detect.get_reading_format file
+        Standard.Base.IO.println reader
+        if reader == Nothing then
+            Standard.Base.IO.println "breakpoint..."
+            Standard.Base.Runtime.Debug.breakpoint
         if reader == Nothing then Error.throw (File_Error.Unsupported_Type file) else
             reader.read file on_problems
 

Then we can run the following file in the command line:

from Standard.Base import all

main =
    f = File.new "test.txt.bak"
    f.delete_if_exists
    "test".write f

    r = f.read
    IO.println r

That will print the following output:

C:\NBO\enso\test.txt.bak
exists? True
Nothing
breakpoint...
>

and put us into an interactive REPL.

Now you can reproduce the following interaction:

C:\NBO\enso\test.txt.bak
exists? True
Nothing
breakpoint...
> 2+2
>>> 4
> xyz = 2+2
Evaluation failed with: Index 3 out of bounds for length 2
java.lang.Exception: Index 3 out of bounds for length 2
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getIndexedTagChecked(FrameWithoutBoxing.java:433)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.verifyIndexedGet(FrameWithoutBoxing.java:422)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getLong(FrameWithoutBoxing.java:354)
        at org.enso.interpreter.node.scope.ReadLocalVariableNode.readLong(ReadLocalVariableNode.java:51)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeAndSpecialize(ReadLocalVariableNodeGen.java:134)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeGeneric(ReadLocalVariableNodeGen.java:85)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:97)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:78)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:55)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:69)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:10)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:69)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.debug.EvalNode.doCached(EvalNode.java:119)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.executeAndSpecialize(EvalNodeGen.java:171)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.execute(EvalNodeGen.java:99)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.evaluate(ReplDebuggerInstrument.java:136)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.onMessage(DebuggerMessageHandler.scala:81)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendBinary(DebuggerMessageHandler.scala:33)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint$ReplExecutorImplementation.evaluate(DebuggerSessionManagerEndpoint.scala:76)
        at org.enso.runner.Repl.startSession(Repl.scala:171)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.startNewSession(DebuggerSessionManagerEndpoint.scala:40)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.handleResponse(DebuggerSessionManagerEndpoint.scala:57)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.sendBinary(DebuggerSessionManagerEndpoint.scala:19)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendToClient(DebuggerMessageHandler.scala:45)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.startSession(DebuggerMessageHandler.scala:61)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.startSession(ReplDebuggerInstrument.java:210)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.onEnter(ReplDebuggerInstrument.java:183)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1390)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:921)
        at com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:215)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeWrapper.execute(DebugBreakpointNodeWrapper.java:44)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGen.execute(DebugBreakpointMethodGen.java:91)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNode.doExecute(IfThenNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNodeGen.execute(IfThenNodeGen.java:26)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen.handleExecute(IfThenMethodGen.java:114)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen$1Inlineable.call(IfThenMethodGen.java:84)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.ExpressionNode.executeVoid(ExpressionNode.java:168)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:78)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:55)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeVoid(AssignmentNodeGen.java:98)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InteropApplicationNode.callCached(InteropApplicationNode.java:81)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.executeAndSpecialize(InteropApplicationNodeGen.java:153)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.execute(InteropApplicationNodeGen.java:102)
        at org.enso.interpreter.runtime.callable.function.Function$Execute.doCall(Function.java:196)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.executeAndSpecialize(FunctionGen.java:121)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.execute(FunctionGen.java:107)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$SharedExecuteNode.doDefault(PolyglotValueDispatch.java:4539)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeAndSpecialize(PolyglotValueDispatchFactory.java:9262)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeShared(PolyglotValueDispatchFactory.java:9214)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$ExecuteNoArgsNode.doDefault(PolyglotValueDispatch.java:4646)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$ExecuteNoArgsNodeGen.executeImpl(PolyglotValueDispatchFactory.java:9721)
        at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedRuntimeSupport.callProfiled(OptimizedRuntimeSupport.java:266)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue.execute(PolyglotValueDispatch.java:2614)
        at org.graalvm.polyglot.Value.execute(Value.java:879)
        at org.enso.polyglot.Function.execute(Function.scala:16)
        at org.enso.runner.Main$.runMain(Main.scala:868)
        at org.enso.runner.Main$.runSingleFile(Main.scala:780)
        at org.enso.runner.Main$.run(Main.scala:662)
        at org.enso.runner.Main$.runMain(Main.scala:1212)
        at org.enso.runner.Main$.$anonfun$main$8(Main.scala:1093)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.enso.runner.Main$.withProfiling(Main.scala:1289)
        at org.enso.runner.Main$.$anonfun$main$7(Main.scala:1093)
        at org.enso.runner.Main$.$anonfun$main$7$adapted(Main.scala:1093)
        at scala.util.Either.fold(Either.scala:189)
        at org.enso.runner.Main$.main(Main.scala:1093)
        at org.enso.runner.Main.main(Main.scala)
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.lang.reflect.Method.invoke(Method.java:580)
        at org.enso.EngineRunnerBootLoader.main(EngineRunnerBootLoader.java:46)

> file.exists
<interactive_source>:1:1: error: The name `file` could not be found.
    1 | file.exists
      | ^~~~
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
        at <enso>.Debug.breakpoint(Unknown Source)
        at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:53)
        at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:48)
        at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:48)
        at <enso>.File.read<arg-2>(File.enso:268)
        at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:267)
        at <enso>.invalid_format::invalid_format::main(invalid_format.enso:3)
        at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

> reader
[Here the interpreter hangs]

So we can see that first, defining a new variable called xyz = 2+2 causes some weird crash within the handling of the local frame, which is then recovered. For some reason afterwards, the file argument that should be in scope is not visible. Then we try to check the value of reader and that hangs the JVM.

@radeusgd
Copy link
Member Author

Another interaction with the above program:

C:\NBO\enso\test.txt.bak
exists? True
Nothing
breakpoint...
> 2+2
>>> 4
> file.exists
Evaluation failed with: Index 2 out of bounds for length 1
java.lang.Exception: Index 2 out of bounds for length 1
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getIndexedTagChecked(FrameWithoutBoxing.java:433)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.verifyIndexedGet(FrameWithoutBoxing.java:422)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getLong(FrameWithoutBoxing.java:354)
        at org.enso.interpreter.node.scope.ReadLocalVariableNode.readLong(ReadLocalVariableNode.java:51)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeAndSpecialize(ReadLocalVariableNodeGen.java:134)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeGeneric(ReadLocalVariableNodeGen.java:85)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:97)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:69)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:10)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:69)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.debug.EvalNode.doCached(EvalNode.java:119)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.executeAndSpecialize(EvalNodeGen.java:171)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.execute(EvalNodeGen.java:99)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.evaluate(ReplDebuggerInstrument.java:136)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.onMessage(DebuggerMessageHandler.scala:81)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendBinary(DebuggerMessageHandler.scala:33)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint$ReplExecutorImplementation.evaluate(DebuggerSessionManagerEndpoint.scala:76)
        at org.enso.runner.Repl.startSession(Repl.scala:171)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.startNewSession(DebuggerSessionManagerEndpoint.scala:40)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.handleResponse(DebuggerSessionManagerEndpoint.scala:57)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.sendBinary(DebuggerSessionManagerEndpoint.scala:19)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendToClient(DebuggerMessageHandler.scala:45)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.startSession(DebuggerMessageHandler.scala:61)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.startSession(ReplDebuggerInstrument.java:210)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.onEnter(ReplDebuggerInstrument.java:183)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1390)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:921)
        at com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:215)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeWrapper.execute(DebugBreakpointNodeWrapper.java:44)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGen.execute(DebugBreakpointMethodGen.java:91)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNode.doExecute(IfThenNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNodeGen.execute(IfThenNodeGen.java:26)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen.handleExecute(IfThenMethodGen.java:114)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen$1Inlineable.call(IfThenMethodGen.java:84)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.ExpressionNode.executeVoid(ExpressionNode.java:168)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:78)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:55)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeVoid(AssignmentNodeGen.java:98)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InteropApplicationNode.callCached(InteropApplicationNode.java:81)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.executeAndSpecialize(InteropApplicationNodeGen.java:153)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.execute(InteropApplicationNodeGen.java:102)
        at org.enso.interpreter.runtime.callable.function.Function$Execute.doCall(Function.java:196)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.executeAndSpecialize(FunctionGen.java:121)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.execute(FunctionGen.java:107)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$SharedExecuteNode.doDefault(PolyglotValueDispatch.java:4539)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeAndSpecialize(PolyglotValueDispatchFactory.java:9262)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeShared(PolyglotValueDispatchFactory.java:9214)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$ExecuteNoArgsNode.doDefault(PolyglotValueDispatch.java:4646)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$ExecuteNoArgsNodeGen.executeImpl(PolyglotValueDispatchFactory.java:9721)
        at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedRuntimeSupport.callProfiled(OptimizedRuntimeSupport.java:266)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue.execute(PolyglotValueDispatch.java:2614)
        at org.graalvm.polyglot.Value.execute(Value.java:879)
        at org.enso.polyglot.Function.execute(Function.scala:16)
        at org.enso.runner.Main$.runMain(Main.scala:868)
        at org.enso.runner.Main$.runSingleFile(Main.scala:780)
        at org.enso.runner.Main$.run(Main.scala:662)
        at org.enso.runner.Main$.runMain(Main.scala:1212)
        at org.enso.runner.Main$.$anonfun$main$8(Main.scala:1093)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.enso.runner.Main$.withProfiling(Main.scala:1289)
        at org.enso.runner.Main$.$anonfun$main$7(Main.scala:1093)
        at org.enso.runner.Main$.$anonfun$main$7$adapted(Main.scala:1093)
        at scala.util.Either.fold(Either.scala:189)
        at org.enso.runner.Main$.main(Main.scala:1093)
        at org.enso.runner.Main.main(Main.scala)
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.lang.reflect.Method.invoke(Method.java:580)
        at org.enso.EngineRunnerBootLoader.main(EngineRunnerBootLoader.java:46)

> file.exists
<interactive_source>:1:1: error: The name `file` could not be found.
    1 | file.exists
      | ^~~~
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
        at <enso>.Debug.breakpoint(Unknown Source)
        at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:53)
        at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:48)
        at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:48)
        at <enso>.File.read<arg-2>(File.enso:268)
        at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:267)
        at <enso>.invalid_format::invalid_format::main(invalid_format.enso:3)
        at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

> file.exists
<interactive_source>:1:1: error: The name `file` could not be found.
    1 | file.exists
      | ^~~~
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
        at <enso>.Debug.breakpoint(Unknown Source)
        at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:53)
        at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:48)
        at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:48)
        at <enso>.File.read<arg-2>(File.enso:268)
        at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:267)
        at <enso>.invalid_format::invalid_format::main(invalid_format.enso:3)
        at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

> file
[HANGS again]

Here we can see that first accessing file.exists again causes the internal error, and later accesses fail with compile error. But then if we try to print just file it hangs again.

This time I've run it under a debugger and so we can pause the threads and see what the JVM is doing: threads_report.txt

This is weird as it looks as if it is just waiting to read next line from the REPL. But we clearly see it is not, as we did not get another > prompt.

@radeusgd
Copy link
Member Author

radeusgd commented Nov 28, 2023

Now this is weird, it seems that even if I just turn on regular --repl, I sometimes seem to get this 'hanging' effect:

> 2+2
>>> 4
> f1 = File.new "f1.txt"
[hangs seemingly forever]

This is quite serious as it makes the REPL virtually unusable.

@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Nov 28, 2023
@radeusgd
Copy link
Member Author

Part of this issue seems to have been fixed by #8496 - after rebuilding I no longer get the behaviour where the REPL hangs forever (waiting for input).

However, the issue with exceptions when trying to inspect variables in scope still remains:

C:\NBO\enso\test.txt.bak
exists? True
Nothing
breakpoint...
> 2+2
>>> 4
> xyz = 2+2
Evaluation failed with: Index 3 out of bounds for length 2
java.lang.Exception: Index 3 out of bounds for length 2
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getIndexedTagChecked(FrameWithoutBoxing.java:433)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.verifyIndexedGet(FrameWithoutBoxing.java:422)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getLong(FrameWithoutBoxing.java:354)
        at org.enso.interpreter.node.scope.ReadLocalVariableNode.readLong(ReadLocalVariableNode.java:51)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeAndSpecialize(ReadLocalVariableNodeGen.java:134)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeGeneric(ReadLocalVariableNodeGen.java:85)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:97)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:78)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:55)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:69)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:10)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:69)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.debug.EvalNode.doCached(EvalNode.java:121)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.executeAndSpecialize(EvalNodeGen.java:171)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.execute(EvalNodeGen.java:99)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.evaluate(ReplDebuggerInstrument.java:136)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.onMessage(DebuggerMessageHandler.scala:81)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendBinary(DebuggerMessageHandler.scala:33)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint$ReplExecutorImplementation.evaluate(DebuggerSessionManagerEndpoint.scala:76)
        at org.enso.runner.Repl.startSession(Repl.scala:179)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.startNewSession(DebuggerSessionManagerEndpoint.scala:40)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.handleResponse(DebuggerSessionManagerEndpoint.scala:57)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.sendBinary(DebuggerSessionManagerEndpoint.scala:19)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendToClient(DebuggerMessageHandler.scala:45)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.startSession(DebuggerMessageHandler.scala:61)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.startSession(ReplDebuggerInstrument.java:210)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.onEnter(ReplDebuggerInstrument.java:183)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1390)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:921)
        at com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:215)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeWrapper.execute(DebugBreakpointNodeWrapper.java:44)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGen.execute(DebugBreakpointMethodGen.java:91)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNode.doExecute(IfThenNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNodeGen.execute(IfThenNodeGen.java:26)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen.handleExecute(IfThenMethodGen.java:114)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen$1Inlineable.call(IfThenMethodGen.java:84)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.ExpressionNode.executeVoid(ExpressionNode.java:168)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:78)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:55)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeVoid(AssignmentNodeGen.java:98)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InteropApplicationNode.callCached(InteropApplicationNode.java:81)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.executeAndSpecialize(InteropApplicationNodeGen.java:153)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.execute(InteropApplicationNodeGen.java:102)
        at org.enso.interpreter.runtime.callable.function.Function$Execute.doCall(Function.java:196)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.executeAndSpecialize(FunctionGen.java:121)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.execute(FunctionGen.java:107)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$SharedExecuteNode.doDefault(PolyglotValueDispatch.java:4539)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeAndSpecialize(PolyglotValueDispatchFactory.java:9262)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeShared(PolyglotValueDispatchFactory.java:9214)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$ExecuteNoArgsNode.doDefault(PolyglotValueDispatch.java:4646)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$ExecuteNoArgsNodeGen.executeImpl(PolyglotValueDispatchFactory.java:9721)
        at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedRuntimeSupport.callProfiled(OptimizedRuntimeSupport.java:266)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue.execute(PolyglotValueDispatch.java:2614)
        at org.graalvm.polyglot.Value.execute(Value.java:879)
        at org.enso.polyglot.Function.execute(Function.scala:16)
        at org.enso.runner.Main$.runMain(Main.scala:868)
        at org.enso.runner.Main$.runSingleFile(Main.scala:780)
        at org.enso.runner.Main$.run(Main.scala:662)
        at org.enso.runner.Main$.runMain(Main.scala:1212)
        at org.enso.runner.Main$.$anonfun$main$8(Main.scala:1093)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.enso.runner.Main$.withProfiling(Main.scala:1289)
        at org.enso.runner.Main$.$anonfun$main$7(Main.scala:1093)
        at org.enso.runner.Main$.$anonfun$main$7$adapted(Main.scala:1093)
        at scala.util.Either.fold(Either.scala:189)
        at org.enso.runner.Main$.main(Main.scala:1093)
        at org.enso.runner.Main.main(Main.scala)
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.lang.reflect.Method.invoke(Method.java:580)
        at org.enso.EngineRunnerBootLoader.main(EngineRunnerBootLoader.java:46)

> file.exists
<interactive_source>:1:1: error: The name `file` could not be found.
    1 | file.exists
      | ^~~~
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
        at <enso>.Debug.breakpoint(Unknown Source)
        at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:53)
        at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:48)
        at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:48)
        at <enso>.File.read<arg-2>(File.enso:268)
        at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:267)
        at <enso>.b::b::main(b.enso:3)
        at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

> reader
Evaluation failed with: Index 2 out of bounds for length 1
java.lang.Exception: Index 2 out of bounds for length 1
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getIndexedTagChecked(FrameWithoutBoxing.java:433)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.verifyIndexedGet(FrameWithoutBoxing.java:422)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getLong(FrameWithoutBoxing.java:354)
        at org.enso.interpreter.node.scope.ReadLocalVariableNode.readLong(ReadLocalVariableNode.java:51)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeAndSpecialize(ReadLocalVariableNodeGen.java:134)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeGeneric(ReadLocalVariableNodeGen.java:85)
        at org.enso.interpreter.node.callable.thunk.ForceNodeGen.executeGeneric(ForceNodeGen.java:46)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:69)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:10)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:69)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.debug.EvalNode.doCached(EvalNode.java:121)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.executeAndSpecialize(EvalNodeGen.java:171)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.execute(EvalNodeGen.java:99)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.evaluate(ReplDebuggerInstrument.java:136)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.onMessage(DebuggerMessageHandler.scala:81)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendBinary(DebuggerMessageHandler.scala:33)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint$ReplExecutorImplementation.evaluate(DebuggerSessionManagerEndpoint.scala:76)
        at org.enso.runner.Repl.startSession(Repl.scala:179)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.startNewSession(DebuggerSessionManagerEndpoint.scala:40)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.handleResponse(DebuggerSessionManagerEndpoint.scala:57)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.sendBinary(DebuggerSessionManagerEndpoint.scala:19)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendToClient(DebuggerMessageHandler.scala:45)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.startSession(DebuggerMessageHandler.scala:61)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.startSession(ReplDebuggerInstrument.java:210)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.onEnter(ReplDebuggerInstrument.java:183)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1390)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:921)
        at com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:215)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeWrapper.execute(DebugBreakpointNodeWrapper.java:44)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGen.execute(DebugBreakpointMethodGen.java:91)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNode.doExecute(IfThenNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNodeGen.execute(IfThenNodeGen.java:26)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen.handleExecute(IfThenMethodGen.java:114)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen$1Inlineable.call(IfThenMethodGen.java:84)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.ExpressionNode.executeVoid(ExpressionNode.java:168)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:78)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:55)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeVoid(AssignmentNodeGen.java:98)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InteropApplicationNode.callCached(InteropApplicationNode.java:81)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.executeAndSpecialize(InteropApplicationNodeGen.java:153)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.execute(InteropApplicationNodeGen.java:102)
        at org.enso.interpreter.runtime.callable.function.Function$Execute.doCall(Function.java:196)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.executeAndSpecialize(FunctionGen.java:121)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.execute(FunctionGen.java:107)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$SharedExecuteNode.doDefault(PolyglotValueDispatch.java:4539)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeAndSpecialize(PolyglotValueDispatchFactory.java:9262)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeShared(PolyglotValueDispatchFactory.java:9214)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$ExecuteNoArgsNode.doDefault(PolyglotValueDispatch.java:4646)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$ExecuteNoArgsNodeGen.executeImpl(PolyglotValueDispatchFactory.java:9721)
        at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedRuntimeSupport.callProfiled(OptimizedRuntimeSupport.java:266)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue.execute(PolyglotValueDispatch.java:2614)
        at org.graalvm.polyglot.Value.execute(Value.java:879)
        at org.enso.polyglot.Function.execute(Function.scala:16)
        at org.enso.runner.Main$.runMain(Main.scala:868)
        at org.enso.runner.Main$.runSingleFile(Main.scala:780)
        at org.enso.runner.Main$.run(Main.scala:662)
        at org.enso.runner.Main$.runMain(Main.scala:1212)
        at org.enso.runner.Main$.$anonfun$main$8(Main.scala:1093)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.enso.runner.Main$.withProfiling(Main.scala:1289)
        at org.enso.runner.Main$.$anonfun$main$7(Main.scala:1093)
        at org.enso.runner.Main$.$anonfun$main$7$adapted(Main.scala:1093)
        at scala.util.Either.fold(Either.scala:189)
        at org.enso.runner.Main$.main(Main.scala:1093)
        at org.enso.runner.Main.main(Main.scala)
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.lang.reflect.Method.invoke(Method.java:580)
        at org.enso.EngineRunnerBootLoader.main(EngineRunnerBootLoader.java:46)

> reader
<interactive_source>:1:1: error: The name `reader` could not be found.
    1 | reader
      | ^~~~~~
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
        at <enso>.Debug.breakpoint(Unknown Source)
        at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:53)
        at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:48)
        at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:48)
        at <enso>.File.read<arg-2>(File.enso:268)
        at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:267)
        at <enso>.b::b::main(b.enso:3)
        at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

> reader
Evaluation failed with: Index 2 out of bounds for length 1
java.lang.Exception: Index 2 out of bounds for length 1
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getIndexedTagChecked(FrameWithoutBoxing.java:433)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.verifyIndexedGet(FrameWithoutBoxing.java:422)
        at com.oracle.truffle.api.impl.FrameWithoutBoxing.getLong(FrameWithoutBoxing.java:354)
        at org.enso.interpreter.node.scope.ReadLocalVariableNode.readLong(ReadLocalVariableNode.java:51)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeAndSpecialize(ReadLocalVariableNodeGen.java:134)
        at org.enso.interpreter.node.scope.ReadLocalVariableNodeGen.executeGeneric(ReadLocalVariableNodeGen.java:85)
        at org.enso.interpreter.node.callable.thunk.ForceNodeGen.executeGeneric(ForceNodeGen.java:46)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:69)
        at org.enso.interpreter.node.expression.debug.CaptureResultScopeNode.executeGeneric(CaptureResultScopeNode.java:10)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:69)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.debug.EvalNode.doCached(EvalNode.java:121)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.executeAndSpecialize(EvalNodeGen.java:171)
        at org.enso.interpreter.node.expression.debug.EvalNodeGen.execute(EvalNodeGen.java:99)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.evaluate(ReplDebuggerInstrument.java:136)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.onMessage(DebuggerMessageHandler.scala:81)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendBinary(DebuggerMessageHandler.scala:33)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint$ReplExecutorImplementation.evaluate(DebuggerSessionManagerEndpoint.scala:76)
        at org.enso.runner.Repl.startSession(Repl.scala:179)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.startNewSession(DebuggerSessionManagerEndpoint.scala:40)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.handleResponse(DebuggerSessionManagerEndpoint.scala:57)
        at org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.sendBinary(DebuggerSessionManagerEndpoint.scala:19)
        at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.sendToClient(DebuggerMessageHandler.scala:45)
        at org.enso.interpreter.instrument.DebuggerMessageHandler.startSession(DebuggerMessageHandler.scala:61)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.startSession(ReplDebuggerInstrument.java:210)
        at org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.onEnter(ReplDebuggerInstrument.java:183)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1390)
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:921)
        at com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:215)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeWrapper.execute(DebugBreakpointNodeWrapper.java:44)
        at org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGen.execute(DebugBreakpointMethodGen.java:91)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNode.doExecute(IfThenNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenNodeGen.execute(IfThenNodeGen.java:26)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen.handleExecute(IfThenMethodGen.java:114)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenMethodGen$1Inlineable.call(IfThenMethodGen.java:84)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.ExpressionNode.executeVoid(ExpressionNode.java:168)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:66)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:208)
        at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:168)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseNode.execute(IfThenElseNode.java:32)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen.handleExecute(IfThenElseMethodGen.java:125)
        at org.enso.interpreter.node.expression.builtin.bool.IfThenElseMethodGen$1Inlineable.call(IfThenElseMethodGen.java:87)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callInlineable(ExecuteCallNode.java:63)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:138)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:155)
        at org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:108)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:160)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
        at org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
        at org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
        at org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
        at org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:78)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:55)
        at org.enso.interpreter.node.scope.AssignmentNodeGen.executeVoid(AssignmentNodeGen.java:98)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
        at org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
        at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
        at com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:91)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
        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:115)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
        at org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
        at org.enso.interpreter.node.callable.InteropApplicationNode.callCached(InteropApplicationNode.java:81)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.executeAndSpecialize(InteropApplicationNodeGen.java:153)
        at org.enso.interpreter.node.callable.InteropApplicationNodeGen.execute(InteropApplicationNodeGen.java:102)
        at org.enso.interpreter.runtime.callable.function.Function$Execute.doCall(Function.java:196)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.executeAndSpecialize(FunctionGen.java:121)
        at org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.execute(FunctionGen.java:107)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$SharedExecuteNode.doDefault(PolyglotValueDispatch.java:4539)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeAndSpecialize(PolyglotValueDispatchFactory.java:9262)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeShared(PolyglotValueDispatchFactory.java:9214)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$ExecuteNoArgsNode.doDefault(PolyglotValueDispatch.java:4646)
        at com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$ExecuteNoArgsNodeGen.executeImpl(PolyglotValueDispatchFactory.java:9721)
        at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
        at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
        at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
        at com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
        at com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
        at com.oracle.truffle.runtime.OptimizedRuntimeSupport.callProfiled(OptimizedRuntimeSupport.java:266)
        at com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue.execute(PolyglotValueDispatch.java:2614)
        at org.graalvm.polyglot.Value.execute(Value.java:879)
        at org.enso.polyglot.Function.execute(Function.scala:16)
        at org.enso.runner.Main$.runMain(Main.scala:868)
        at org.enso.runner.Main$.runSingleFile(Main.scala:780)
        at org.enso.runner.Main$.run(Main.scala:662)
        at org.enso.runner.Main$.runMain(Main.scala:1212)
        at org.enso.runner.Main$.$anonfun$main$8(Main.scala:1093)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.enso.runner.Main$.withProfiling(Main.scala:1289)
        at org.enso.runner.Main$.$anonfun$main$7(Main.scala:1093)
        at org.enso.runner.Main$.$anonfun$main$7$adapted(Main.scala:1093)
        at scala.util.Either.fold(Either.scala:189)
        at org.enso.runner.Main$.main(Main.scala:1093)
        at org.enso.runner.Main.main(Main.scala)
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.lang.reflect.Method.invoke(Method.java:580)
        at org.enso.EngineRunnerBootLoader.main(EngineRunnerBootLoader.java:46)

>

@Akirathan Akirathan moved this from 📤 Backlog to ⚙️ Design in Issues Board Dec 22, 2023
@Akirathan
Copy link
Member

I was able to reproduce the original issue to some extent. Sometimes, when in the debugger REPL, typing just file resulted in

<interactive_source>:1:1: error: The name `file` could not be found.
    1 | file
      | ^~~~
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
	at <enso>.Debug.breakpoint(Unknown Source)
	at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:54)
	at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:49)
	at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:49)
	at <enso>.File.read<arg-2>(File.enso:279)
	at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:278)
	at <enso>.tmp::tmp::radek_report(tmp.enso:7)
	at <enso>.tmp::tmp::main(tmp.enso:14)
	at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

However, when running with --no-ir-caches, everything worked as expected.

@Akirathan
Copy link
Member

This is the stack trace in the problematic spot:

java.lang.Exception: Stack trace
	at java.base/java.lang.Thread.dumpStack(Thread.java:2209)
	at org.enso.runtime/org.enso.compiler.Compiler.$anonfun$runInline$1(Compiler.scala:671)
	at org.enso.runtime/scala.Option.map(Option.scala:242)
	at org.enso.runtime/org.enso.compiler.Compiler.runInline(Compiler.scala:669)
	at org.enso.runtime/org.enso.interpreter.node.expression.debug.EvalNode.parseExpression(EvalNode.java:76)
	at org.enso.runtime/org.enso.interpreter.node.expression.debug.EvalNodeGen.executeAndSpecialize(EvalNodeGen.java:148)
	at org.enso.runtime/org.enso.interpreter.node.expression.debug.EvalNodeGen.execute(EvalNodeGen.java:99)
	at org.enso.runtime/org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.evaluate(ReplDebuggerInstrument.java:136)
	at org.enso.runtime/org.enso.interpreter.instrument.DebuggerMessageHandler.onMessage(DebuggerMessageHandler.scala:81)
	at org.enso.runtime/org.enso.interpreter.instrument.DebuggerMessageHandler.sendBinary(DebuggerMessageHandler.scala:33)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
	at org.enso.IsolatedClassLoader//org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint$ReplExecutorImplementation.evaluate(DebuggerSessionManagerEndpoint.scala:76)
	at org.enso.IsolatedClassLoader//org.enso.runner.Repl.startSession(Repl.scala:179)
	at org.enso.IsolatedClassLoader//org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.startNewSession(DebuggerSessionManagerEndpoint.scala:40)
	at org.enso.IsolatedClassLoader//org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.handleResponse(DebuggerSessionManagerEndpoint.scala:57)
	at org.enso.IsolatedClassLoader//org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint.sendBinary(DebuggerSessionManagerEndpoint.scala:19)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.TruffleInstrument$Env$MessageTransportProxy$MessageEndpointProxy.sendBinary(TruffleInstrument.java:1201)
	at org.enso.runtime/org.enso.interpreter.instrument.DebuggerMessageHandler.sendToClient(DebuggerMessageHandler.scala:45)
	at org.enso.runtime/org.enso.interpreter.instrument.DebuggerMessageHandler.startSession(DebuggerMessageHandler.scala:61)
	at org.enso.runtime/org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.startSession(ReplDebuggerInstrument.java:210)
	at org.enso.runtime/org.enso.interpreter.instrument.ReplDebuggerInstrument$ReplExecutionEventNodeImpl.onEnter(ReplDebuggerInstrument.java:183)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1390)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:921)
	at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:215)
	at org.enso.runtime/org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointNodeWrapper.execute(DebugBreakpointNodeWrapper.java:44)
	at org.enso.runtime/org.enso.interpreter.node.expression.builtin.debug.DebugBreakpointMethodGen.execute(DebugBreakpointMethodGen.java:91)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:94)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:161)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:107)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:116)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:161)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:261)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
	at org.enso.runtime/org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
	at org.enso.runtime/org.enso.interpreter.node.ExpressionNode.executeVoid(ExpressionNode.java:164)
	at org.enso.runtime/org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:52)
	at org.enso.runtime/org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
	at org.enso.runtime/org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:94)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:159)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:107)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:116)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeMethodNode.doFunctionalDispatchCachedSymbol(InvokeMethodNode.java:161)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:586)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:507)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:261)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeCallableNodeGen.executeAndSpecialize(InvokeCallableNodeGen.java:200)
	at org.enso.runtime/org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:158)
	at org.enso.runtime/org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
	at org.enso.runtime/org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
	at org.enso.runtime/org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:54)
	at org.enso.runtime/org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:535)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:94)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:94)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeAndSpecialize(ExecuteCallNodeGen.java:171)
	at org.enso.runtime/org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:101)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(SimpleCallOptimiserNode.java:56)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.CurryNode.doCall(CurryNode.java:161)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.CurryNode.execute(CurryNode.java:107)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNode.invokeCached(InvokeFunctionNode.java:116)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.executeAndSpecialize(InvokeFunctionNodeGen.java:137)
	at org.enso.runtime/org.enso.interpreter.node.callable.dispatch.InvokeFunctionNodeGen.execute(InvokeFunctionNodeGen.java:99)
	at org.enso.runtime/org.enso.interpreter.node.callable.InteropApplicationNode.callCached(InteropApplicationNode.java:81)
	at org.enso.runtime/org.enso.interpreter.node.callable.InteropApplicationNodeGen.executeAndSpecialize(InteropApplicationNodeGen.java:153)
	at org.enso.runtime/org.enso.interpreter.node.callable.InteropApplicationNodeGen.execute(InteropApplicationNodeGen.java:102)
	at org.enso.runtime/org.enso.interpreter.runtime.callable.function.Function$Execute.doCall(Function.java:200)
	at org.enso.runtime/org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.executeAndSpecialize(FunctionGen.java:121)
	at org.enso.runtime/org.enso.interpreter.runtime.callable.function.FunctionGen$InteropLibraryExports$Cached.execute(FunctionGen.java:107)
	at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.execute(InteropLibrary.java:3102)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$SharedExecuteNode.doDefault(PolyglotValueDispatch.java:4539)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeAndSpecialize(PolyglotValueDispatchFactory.java:9262)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedExecuteNodeGen$Inlined.executeShared(PolyglotValueDispatchFactory.java:9214)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$ExecuteNoArgsNode.doDefault(PolyglotValueDispatch.java:4646)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$ExecuteNoArgsNodeGen.executeImpl(PolyglotValueDispatchFactory.java:9721)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:746)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedRuntimeSupport.callProfiled(OptimizedRuntimeSupport.java:266)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue.execute(PolyglotValueDispatch.java:2614)
	at org.graalvm.polyglot/org.graalvm.polyglot.Value.execute(Value.java:879)
	at org.enso.IsolatedClassLoader//org.enso.polyglot.Function.execute(Function.scala:16)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.runMain(Main.scala:868)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.runSingleFile(Main.scala:780)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.run(Main.scala:662)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.runMain(Main.scala:1212)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.$anonfun$main$8(Main.scala:1093)
	at org.enso.IsolatedClassLoader//scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.withProfiling(Main.scala:1289)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.$anonfun$main$7(Main.scala:1093)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.$anonfun$main$7$adapted(Main.scala:1093)
	at org.enso.IsolatedClassLoader//scala.util.Either.fold(Either.scala:189)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main$.main(Main.scala:1093)
	at org.enso.IsolatedClassLoader//org.enso.runner.Main.main(Main.scala)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.enso.runtime/org.enso.EngineRunnerBootLoader.main(EngineRunnerBootLoader.java:46)

It appears that the problem is in Compiler.runInline, it cannot find file in GlobalName passes.

@Akirathan
Copy link
Member

I don't know how to proceed further. Since --no-ir-caches mitigates the issue, let's postpone it.

@github-project-automation github-project-automation bot moved this from ⚙️ Design to 🟢 Accepted in Issues Board Dec 22, 2023
@radeusgd
Copy link
Member Author

I don't know how to proceed further. Since --no-ir-caches mitigates the issue, let's postpone it.

Why? It shows that our IR caches have a bug. We should fix that, no?

@radeusgd
Copy link
Member Author

I just did a fully clean build with the above patch applied, and run the repro above.

I don't see the scary frame access errors indeed, but it is still a defect that I cannot access the variables in scope in the REPL:

C:\NBO\enso\test.txt.bak
exists? True
Nothing
breakpoint...
> file
<interactive_source>:1:1: error: The name `file` could not be found.
    1 | file
      | ^~~~
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
        at <enso>.Debug.breakpoint(Unknown Source)
        at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:54)
        at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:49)
        at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:49)
        at <enso>.File.read<arg-2>(File.enso:279)
        at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:278)
        at <enso>.test::test::main(test.enso:3)
        at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

Nor if I define a new variable, it cannot be accessed:

> x = 2
<interactive_source>:1:1: warning: Unused variable x.
    1 | x = 2
      | ^
>>> Nothing
> x
<interactive_source>:1:1: error: The name `x` could not be found.
    1 | x
      | ^
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
        at <enso>.Debug.breakpoint(Unknown Source)
        at <enso>.Auto_Detect.read<arg-1>(File_Format.enso:54)
        at <enso>.Auto_Detect.read<arg-2>(File_Format.enso:49)
        at <enso>.Standard.Base.System.File_Format::Standard.Base.System.File_Format.Auto_Detect::read(File_Format.enso:49)
        at <enso>.File.read<arg-2>(File.enso:279)
        at <enso>.Standard.Base.System.File::Standard.Base.System.File.File::read(File.enso:278)
        at <enso>.test::test::main(test.enso:3)
        at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)

I agree this is not the most pressing issue, as it does not affect our end-users directly.

But it does very much limit the usability of our Debugger.breakpoint feature - to the point it could almost be disabled as it's useless. I think we should fix this at some point.


Interestingly enough, indeed if I run with --no-ir-caches, the REPL features start working again:

C:\NBO\enso\test.txt.bak
exists? True
Nothing
breakpoint...
> file
>>> (File test.txt.bak)
> x = 2
<interactive_source>:1:1: warning: Unused variable x.
    1 | x = 2
      | ^
>>> Nothing
> x
>>> 2

That is good to know - that there is a simple and robust workaround.

It still makes me very worried - what is happening in the IR caching logic that makes such weird errors. This definitely should not be happening with IR caches enabled and I'm worried that the bug that is causing this behaviour may also cause unexpected behaviour in our regular user code - which may be much harder to debug than this simple example.

@radeusgd radeusgd reopened this Dec 22, 2023
@github-project-automation github-project-automation bot moved this from 🟢 Accepted to ❓New in Issues Board Dec 22, 2023
@radeusgd radeusgd added p-low Low priority p-lowest Should be completed at some point and removed p-low Low priority labels Dec 22, 2023
@radeusgd radeusgd changed the title REPL debugger fails or hangs under some unclear circumstances Debug.breakpoint is sometimes not seeing variables defined in the parent scope, nor ones defined within the REPL; only if IR caches are enabled Dec 22, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler p-lowest Should be completed at some point
Projects
Status: 📤 Backlog
Development

No branches or pull requests

2 participants