cursive

Issues at: https://git.io/cursive-issues
aratare 2021-06-28T01:14:54.099100Z

@cfleming Sure thing. I’m working on this one https://github.com/aratare-jp/epsilon-clj

cfleming 2021-06-28T01:31:32.099400Z

Ok, and how can I reproduce it? Just set up a REPL and run?

aratare 2021-06-28T01:32:19.099600Z

Yep. Just right click the project and choose Run REPL

aratare 2021-06-28T01:33:33.099800Z

One thing I’ve noticed is that this happens so randomly I can’t really give you a more concrete way to reproduce it. But of all the time that it did occur, it’s always caused by Run REPL.

aratare 2021-06-28T01:35:49.100Z

When I tried it a couple of months back, running lein repl in a terminal would somehow make this go away. When I tried it yesterday, the error persisted even after multiple lein repl.

cfleming 2021-06-28T01:41:08.100200Z

Yeah, I just tried it and it worked fine. Do you have any plugins in your user.clj?

aratare 2021-06-28T01:42:26.100400Z

Nope. I tend to keep things in my projects instead.

cfleming 2021-06-28T01:42:42.100600Z

Do you have profiles selected in your run config?

aratare 2021-06-28T01:43:02.100800Z

Actually yes. I was trying with dev yesterday.

cfleming 2021-06-28T01:43:34.101Z

When I try with dev, I get:

Error loading nrepl.server: Could not locate nrepl/server__init.class, nrepl/server.clj or nrepl/server.cljc on classpath.
Error loading complete.core: Could not locate complete/core__init.class, complete/core.clj or complete/core.cljc on classpath.
Syntax error (ClassNotFoundException) compiling at (/private/var/folders/__/8l603gyx7t15k39pyjk0c0xr0000gn/T/form-init1414398454383792338.clj:1:1190).
nrepl.server

cfleming 2021-06-28T01:47:34.101500Z

But I don’t know what would provoke the exception.

cfleming 2021-06-28T01:48:36.101700Z

I can try to track down why the error isn’t having more useful data output, but it would be really helpful to be able to reproduce it.

cfleming 2021-06-28T01:53:09.101900Z

Ok, I fixed those errors by including nrepl and clojure-complete in the dependencies. Still no failure though.

cfleming 2021-06-28T01:54:11.102100Z

Can you email me your log file to <mailto:cursive@cursive-ide.com|cursive@cursive-ide.com>? Help | Show log in Finder/Explorer

aratare 2021-06-28T01:54:16.102300Z

This is what I’m experiencing at the moment.

aratare 2021-06-28T01:54:28.102700Z

Sure will do now.

aratare 2021-06-28T02:00:28.102900Z

Sent

cfleming 2021-06-28T02:08:49.103100Z

Thanks. So there’s nothing related in the logs unfortunately, but I think I see what the problem is with some of the exception data being lost.

cfleming 2021-06-28T02:09:50.103300Z

Actually, looking at that line in Cloverage, it looks like it’s totally eating the exception data anyway.

cfleming 2021-06-28T02:10:59.103500Z

I also don’t understand how that might get invoked from just starting a REPL.

aratare 2021-06-28T02:14:32.103700Z

Correct me if I’m wrong, but when you select profiles in the Leiningen tab in Cursive, that’s just for compiling stuff right?

aratare 2021-06-28T02:14:54.103900Z

Because I have test checked as one of the profiles

cfleming 2021-06-28T02:15:26.104100Z

That’s for what gets synced to the project. If you’re running your REPL with Leiningen, it shouldn’t matter.

aratare 2021-06-28T02:15:55.104300Z

Well other than that, I honestly have no idea why Cloverage would be invoked because I think I haven’t done any weird setup afaict.

aratare 2021-06-28T02:16:45.104500Z

But if I intentionally invoke Cloverage with lein cloverage, it works fine 😅

cfleming 2021-06-28T02:19:38.104700Z

Hang on, I’ll try to create a dev build with better logging, to see if that helps.

aratare 2021-06-28T02:34:41.104900Z

Thanks a lot for looking into this 🙂

2021-06-28T14:09:52.105400Z

Are there any plans to get “Interrupt Current Evaluation” working for socket repls?

borkdude 2021-06-29T09:26:44.116500Z

@potetm afaik, nREPL uses Thread#stop which has long been deprecated

borkdude 2021-06-29T09:28:49.116700Z

I have a similar problem with the nREPL server of babashka. I can't use Thread#stop there because it's not supported anymore in the GraalVM JDK

borkdude 2021-06-29T09:29:31.116900Z

Someone on the graalvm slack suggested to me to use safepoints

borkdude 2021-06-29T09:29:40.117100Z

haven't looked into it though

2021-06-29T13:59:53.121100Z

It does use stop, but I’ve never had a problem with it.

2021-06-29T14:00:57.121300Z

AFAIK the biggest problem with stop is that it doesn’t release monitors — which aren’t really an issue in clojure.

2021-06-29T14:01:16.121500Z

at any rate, an interrupt would probably do

borkdude 2021-06-29T14:03:52.121700Z

an interrupt won't kill a thread running (doall (range))

cfleming 2021-06-29T22:09:33.122300Z

There’s no way to kill that (or in general, any uncooperative REPL process) except Thread/kill

borkdude 2021-06-29T22:19:12.122500Z

you mean Thread#stop right

cfleming 2021-06-29T22:53:17.122700Z

Yes, that one.

cfleming 2021-06-29T22:53:59.122900Z

BTW the problem is not actually that monitors are not released, it’s quite the opposite: > Stopping a thread causes it to unlock all the monitors that it has locked. (The monitors are unlocked as the ThreadDeath exception propagates up the stack.) If any of the objects previously protected by these monitors were in an inconsistent state, other threads may now view these objects in an inconsistent state. Such objects are said to be damaged. When threads operate on damaged objects, arbitrary behavior can result. This behavior may be subtle and difficult to detect, or it may be pronounced. Unlike other unchecked exceptions, ThreadDeath kills threads silently; thus, the user has no warning that his program may be corrupted. The corruption can manifest itself at any time after the actual damage occurs, even hours or days in the future.

cfleming 2021-06-29T23:03:40.123300Z

The risk is pretty low for a REPL IMO

✔️ 2
2021-06-29T23:14:48.123600Z

Ah yeah, that’s right.

imre 2021-06-28T14:10:19.105500Z

I'm not sure that's possible, I think it's a feature of nrepl

2021-06-28T14:12:10.105900Z

It’s possible. It’s a matter of what payload you use to set things up.

2021-06-28T14:12:40.106100Z

nrepl just wraps every execution on a thread, and it calls Thread/kill on cancelation

2021-06-28T14:13:29.106300Z

At worst cursive would rely on the user to set up a specific :accept fn.

imre 2021-06-28T14:14:52.106500Z

I see. I'm probably not well-informed in the topic, I only based my initial comment on what I read in the article I linked