nrepl / weasel

ClojureScript browser REPL using WebSockets
The Unlicense
324 stars 35 forks source link

StackOverflowError when starting repl #34

Closed Gonzih closed 9 years ago

Gonzih commented 10 years ago

Hi, I tried to integrate weasel in to my current problem and got stuck with some weird error.

I have pretty big folder with bunch of clojurescript namespaces that use reagent. Without this folder everything works fine. With this namespace I'm getting error:

StackOverflowError   clojure.lang.AFn.applyToHelper (AFn.java:148)

Funny enough, when I remove all files from this folder, except main one (core.cljs) I'm getting different error:

StackOverflowError   clojure.lang.Murmur3.hashUnencodedChars (Murmur3.java:76)

There are no warning or compilation errors in cljsbuild for my code, everything works like a charm. Any tips where I should look for the solution? Thanks!

Gonzih commented 10 years ago

Here is terminal output from repl session, but looks like it's related to the io exception.

nREPL server started on port 50830 on host 127.0.0.1 - nrepl://127.0.0.1:50830
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
OpenJDK 64-Bit Server VM 1.7.0-u65-b32
Time for  REPL Driven Development!
[vd.repl]cλ: java.io.IOException: No client connected to Websocket
        at weasel.repl.server$send_BANG_.invoke(server.clj:25)
        at weasel.repl.websocket$send_for_eval_BANG_.invoke(websocket.clj:145)
        at weasel.repl.websocket$websocket_eval.invoke(websocket.clj:124)
        at weasel.repl.websocket.WebsocketEnv._evaluate(websocket.clj:35)
        at cljs.repl$evaluate_form.invoke(repl.clj:113)
        at cemerick.piggieback$cljs_eval$fn__4815.invoke(piggieback.clj:115)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at cemerick.piggieback$cljs_eval.invoke(piggieback.clj:97)
        at clojure.lang.AFn.applyToHelper(AFn.java:160)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at cemerick.piggieback$cljs_repl$fn__4859.doInvoke(piggieback.clj:173)
        at clojure.lang.RestFn.invoke(RestFn.java:436)
        at clojure.lang.Var.invoke(Var.java:388)
        at user$eval11500.invoke(form-init3682606388395356522.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6666)
        at clojure.core$eval.invoke(core.clj:2927)
        at clojure.main$repl$read_eval_print__6625$fn__6628.invoke(main.clj:239)
        at clojure.main$repl$read_eval_print__6625.invoke(main.clj:239)
        at clojure.main$repl$fn__6634.invoke(main.clj:257)
        at clojure.main$repl.doInvoke(main.clj:257)
        at clojure.lang.RestFn.invoke(RestFn.java:1523)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__4173.invoke(interruptible_eval.clj:67)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:51)
        at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__4215$fn__4218.invoke(interruptible_eval.clj:183)
        at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__4208.invoke(interruptible_eval.clj:152)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
java.io.IOException: No client connected to Websocket
        at weasel.repl.server$send_BANG_.invoke(server.clj:25)
        at weasel.repl.websocket$send_for_eval_BANG_.invoke(websocket.clj:145)
        at weasel.repl.websocket$websocket_eval.invoke(websocket.clj:124)
        at weasel.repl.websocket.WebsocketEnv._evaluate(websocket.clj:35)
        at cljs.repl$evaluate_form.invoke(repl.clj:113)
        at cemerick.piggieback$cljs_eval$fn__4815.invoke(piggieback.clj:115)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at cemerick.piggieback$cljs_eval.invoke(piggieback.clj:97)
        at clojure.lang.AFn.applyToHelper(AFn.java:160)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at cemerick.piggieback$cljs_repl$fn__4859.doInvoke(piggieback.clj:173)
        at clojure.lang.RestFn.invoke(RestFn.java:436)
        at clojure.lang.Var.invoke(Var.java:388)
        at user$eval11502.invoke(form-init3682606388395356522.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6666)
        at clojure.core$eval.invoke(core.clj:2927)
        at clojure.main$repl$read_eval_print__6625$fn__6628.invoke(main.clj:239)
        at clojure.main$repl$read_eval_print__6625.invoke(main.clj:239)
        at clojure.main$repl$fn__6634.invoke(main.clj:257)
        at clojure.main$repl.doInvoke(main.clj:257)
        at clojure.lang.RestFn.invoke(RestFn.java:1523)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__4173.invoke(interruptible_eval.clj:67)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:51)
        at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__4215$fn__4218.invoke(interruptible_eval.clj:183)
        at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__4208.invoke(interruptible_eval.clj:152)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
java.io.IOException: No client connected to Websocket
        at weasel.repl.server$send_BANG_.invoke(server.clj:25)
        at weasel.repl.websocket$send_for_eval_BANG_.invoke(websocket.clj:145)
        at weasel.repl.websocket$websocket_eval.invoke(websocket.clj:124)
        at weasel.repl.websocket.WebsocketEnv._evaluate(websocket.clj:35)
        at cljs.repl$evaluate_form.invoke(repl.clj:113)
        at cemerick.piggieback$cljs_eval$fn__4815.invoke(piggieback.clj:115)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at cemerick.piggieback$cljs_eval.invoke(piggieback.clj:97)
        at clojure.lang.AFn.applyToHelper(AFn.java:160)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at cemerick.piggieback$cljs_repl$fn__4859.doInvoke(piggieback.clj:173)
        at clojure.lang.RestFn.invoke(RestFn.java:436)
        at clojure.lang.Var.invoke(Var.java:388)
        at user$eval11504.invoke(form-init3682606388395356522.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6666)
        at clojure.core$eval.invoke(core.clj:2927)
        at clojure.main$repl$read_eval_print__6625$fn__6628.invoke(main.clj:239)
        at clojure.main$repl$read_eval_print__6625.invoke(main.clj:239)
        at clojure.main$repl$fn__6634.invoke(main.clj:257)
        at clojure.main$repl.doInvoke(main.clj:257)
        at clojure.lang.RestFn.invoke(RestFn.java:1523)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__4173.invoke(interruptible_eval.clj:67)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:51)
        at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__4215$fn__4218.invoke(interruptible_eval.clj:183)
        at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__4208.invoke(interruptible_eval.clj:152)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
java.io.IOException: No client connected to Websocket
        at weasel.repl.server$send_BANG_.invoke(server.clj:25)
        at weasel.repl.websocket$send_for_eval_BANG_.invoke(websocket.clj:145)
        at weasel.repl.websocket$websocket_eval.invoke(websocket.clj:124)
        at weasel.repl.websocket.WebsocketEnv._evaluate(websocket.clj:35)
        at cljs.repl$evaluate_form.invoke(repl.clj:113)
        at cemerick.piggieback$cljs_eval$fn__4815.invoke(piggieback.clj:115)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at cemerick.piggieback$cljs_eval.invoke(piggieback.clj:97)
        at clojure.lang.AFn.applyToHelper(AFn.java:160)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at cemerick.piggieback$cljs_repl$fn__4859.doInvoke(piggieback.clj:173)
        at clojure.lang.RestFn.invoke(RestFn.java:436)
        at clojure.lang.Var.invoke(Var.java:388)
        at user$eval11506.invoke(form-init3682606388395356522.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6666)
        at clojure.core$eval.invoke(core.clj:2927)
        at clojure.main$repl$read_eval_print__6625$fn__6628.invoke(main.clj:239)
        at clojure.main$repl$read_eval_print__6625.invoke(main.clj:239)
        at clojure.main$repl$fn__6634.invoke(main.clj:257)
        at clojure.main$repl.doInvoke(main.clj:257)
        at clojure.lang.RestFn.invoke(RestFn.java:1523)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__4173.invoke(interruptible_eval.clj:67)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:51)
        at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__4215$fn__4218.invoke(interruptible_eval.clj:183)
        at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__4208.invoke(interruptible_eval.clj:152)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
tomjakubowski commented 10 years ago

Hmmmm, I'm not sure what's going on here. It's not clear to me when you see those StackOverflowError exceptions, is it when you make the (piggieback/cljs-repl ...) call?

The IOException exceptions would be the result of attempting to evaluate code in a piggiebacked Weasel REPL when there isn't a WebSocket client connected.

Gonzih commented 10 years ago

StackOverflowError happens on repl initialization. So far I'm suspecting apply calls inside piggieback (when require and require-macros statements from ns are merged and apply is called to gather information from analyzer). I tried to change piggieback and reuse updated version from my local maven, but seems like it's not the issue, just a symptom and error is happening inside tools.analyzer.

tomjakubowski commented 9 years ago

Sorry for the late response: @Gonzih were you able to sort this out?

If you don't know (it's been a while since your last comment!) you can avoid the hassle of installing modified dependencies to a local Maven repository by using Leiningen's brilliant checkout dependencies feature.

Gonzih commented 9 years ago

No, sorry. I tried with few releases without much success. Latest release of figwheel includes built in repl, so I'm happily using it nowadays. I think this issue can be closed. Thanks!

On 02/10/2015 01:29 PM, Tom Jakubowski wrote:

Sorry for the late response: @Gonzih https://github.com/Gonzih were you able to sort this out?

If you don't know (it's been a while since your last comment!) you can avoid the hassle of installing modified dependencies to a local Maven repository by using Leiningen's brilliant checkout dependencies https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies feature.

— Reply to this email directly or view it on GitHub https://github.com/tomjakubowski/weasel/issues/34#issuecomment-73691635.