Arcadia icon indicating copy to clipboard operation
Arcadia copied to clipboard

nREPL + break = Object reference not set to an instance of an object

Open saikyun opened this issue 7 years ago • 5 comments

Steps to reproduce

Am on beta commit https://github.com/arcadia-unity/Arcadia/commit/f8eaeaf7843d4f5defc67006b493041a2b0750cb. On master commit https://github.com/arcadia-unity/Arcadia/commit/a44bea75c128e704248617c057dc187549ab8954 it just hangs after (break). Connect to the nREPL server. I've tried cider and miracle.

(use 'arcadia.debug)
(break)

yields

System.NullReferenceException: Object reference not set to an instance of an object
 at clojure.lang.Future.deref (:0)
    clojure.lang.Future.get (:0)
    clojure$core$deref_future__2184.invokeStatic (:0)
    clojure$core$deref_future__2184.invoke (:0)
    clojure$core$deref__2191.invokeStatic (:0)
    clojure$core$deref__2191.invoke (:0)
    arcadia$debug$run_breakpoint_receiving_from_off_thread__18430.invokeStatic (:0)
    arcadia$debug$run_breakpoint_receiving_from_off_thread__18430.invoke (:0)
    user/eval__28603 (:0)
    clojure.lang.Compiler.eval (:0)
    clojure.lang.Compiler.eval (:0)
    clojure$core$eval__3112.invokeStatic (:0)
    clojure$core$eval__3112.invoke (:0)
    clojure.lang.Var.invoke (:0)
    Arcadia.NRepl+EvalFn.invoke (/Users/jona/unity/Deck and Hand/Assets/Arcadia/Editor/NRepl.cs:238)
    arcadia$internal$callbacks$run_callbacks__12983.invokeStatic (:0)
    arcadia$internal$callbacks$run_callbacks__12983.invoke (:0)
    arcadia$internal$editor_callbacks$run_callbacks__13077.invokeStatic (:0)
    arcadia$internal$editor_callbacks$run_callbacks__13077.invoke (:0)
    clojure.lang.Var.invoke (:0)
    Arcadia.EditorCallbacks.RunCallbacks (/Users/jona/unity/Deck and Hand/Assets/Arcadia/Editor/EditorCallbacks.cs:25)
    . (:0)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions (/Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)

It works fine when using inf-clojure, so I'm guessing the error has something to do with nREPL.

saikyun avatar Jan 04 '19 14:01 saikyun

I'm on the same beta commit (though using Manjaro Linux + w/ a modification to get reader conditionals to work), and I get what looks like hanging behavior (tried with monroe -- hope to upgrade to miracle soon :) -- and proto-repl). However, if I connect after this using inf-clojure, I see the debug prompt and can interact.

Once the debug prompt is exited and the connection is killed, subsequent attempts at (break) via nrepl lead to:

System.NullReferenceException: Object reference not set to an instance of an object
  clojure.lang.Future.deref ()
  clojure.lang.Future.get ()
* clojure/core/deref-future
* clojure/core/deref
* arcadia/debug/run-breakpoint-receiving-from-off-thread
* user/eval
  clojure.lang.Compiler.eval (object)
  clojure.lang.Compiler.eval (object)
* clojure/core/eval
* clojure.lang.Var
* Arcadia.NRepl+EvalFn compliment/Assets/Arcadia/Editor/NRepl.cs (186:0)

sogaiu avatar Jan 05 '19 10:01 sogaiu

As documented on the wiki the breakpoint system does not work with nREPL yet. We couldn't get it wrapped in time for release so we shelved it. It is something we want to support in the future, though.

nasser avatar Jan 08 '19 18:01 nasser

I see. Is nREPL supposed to become the main way to interact with Arcadia?

saikyun avatar Jan 08 '19 20:01 saikyun

we're planning on keeping both REPLs going forward, but nREPL is meant to be as fully featured as the socket REPL for sure.

nasser avatar Jan 14 '19 22:01 nasser

Okay, good to know. :)

saikyun avatar Jan 15 '19 09:01 saikyun