cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
2021-06-26T16:59:27.180Z

đź‘‹ I'm seeing an issue when passing nil to < where the printer seems to get caught throwing an NPE and losing any useful stack trace (see the brief discussion starting https://clojurians.slack.com/archives/C03S1KBA2/p1624725785482400). In summary: Evaling

(doall (map (partial < 1000) (conj (into [] (range 1000 1002)) nil)))
at a plain REPL gets me
user=>
(doall (map (partial < 1) [1 2 nil]))
Execution error (NullPointerException) at user/eval158 (REPL:1).
null
(note the user/eval158 bit which I think indicates the actual source of the error information) whereas in CIDER (`CIDER 1.1.1 (Plovdiv)`) whacking M-x cider-eval-last-sexp RET yields
1. Unhandled java.lang.NullPointerException
   (No message)
with the following messages in *Messages*
error in process filter: cider-stacktrace-render-frame: Format specifier doesn’t match argument type
error in process filter: Format specifier doesn’t match argument type
Does this sound like a bug to anyone else? I'm happy to open an Issue if it does.

2021-06-26T17:01:30.180300Z

Actually a much shorter reproduction case is just

(< 1 nil)

dpsutton 2021-06-26T17:03:58.181300Z

That’s a bug in elisp I think. It’s in the buffer trying to render the frame

2021-06-26T17:05:33.181600Z

I'd buy that. :)

dpsutton 2021-06-26T17:05:54.182300Z

The error message you are posting there is an emacs logged message, not from clojure

2021-06-26T17:06:15.182900Z

You mean from *Messages*?

dpsutton 2021-06-26T17:06:32.183500Z

There’s a jvm argument to not omit stacktraces on npe. Wondering if you could add that and see

2021-06-26T17:06:58.183900Z

I'm more than happy to add JVM arguments. :)

2021-06-26T17:07:16.184400Z

Need to look up how to do that in deps.edn. I'm just in a simple one file project with a deps.edn file and cider jack in.

2021-06-26T17:07:45.184600Z

Looks like :jvm-opts in the map.

2021-06-26T17:08:04.185100Z

@dpsutton Do you happen to know the option off the top of your head?

2021-06-26T17:08:47.185300Z

Looks like maybe -XX:-OmitStackTraceInFastThrow

dpsutton 2021-06-26T17:09:36.185600Z

Yeah I think so

2021-06-26T17:10:20.185800Z

đź’Ą

2021-06-26T17:10:25.186Z

That did it.

2021-06-26T17:11:57.187300Z

Well actually this is interesting. I guess the JVM is doing some kind of syslog style exception compression since after a couple of evals I get back to getting No message. There's gotta be an option that disables that feature altogether.

2021-06-26T17:13:54.187600Z

Actually it sounds like maybe I'm just straight up not passing the option down to the JVM.

2021-06-26T17:18:31.188200Z

I certainly don't see it on the CL as per pgrep -fla java.

2021-06-26T17:20:23.188500Z

Yep. I need to make an aliases map.

2021-06-26T17:27:23.188900Z

LOL. This feels slightly less than fully documented…

2021-06-26T17:40:38.191600Z

OOOOK finally got it.

$ cat deps.edn
{:deps
 …
 :aliases {:dev {:jvm-opts ["-XX:-OmitStackTraceInFastThrow"]}}}
Followed by M-0 M-x cider-jack-in RET and appending :dev to the CL like
jack-in command: /usr/local/bin/clojure … -M:cider/nrepl:dev
` finally yields the option in pgrep
$ pgrep -fla java
99854 /usr/bin/java -XX:-OmitStackTraceInFastThrow …
and gets me the full stack trace every time I trigger the exception. Whooooo boy that's fun.

dpsutton 2021-06-26T17:45:49.192200Z

Ok so that’s an issue to open. Cider barfs on errors where the stack trace is omitted

❤️ 1
2021-06-26T17:47:06.193Z

On this board, yes? https://github.com/clojure-emacs/cider/issues

đź‘Ť 1