đź‘‹ 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.Actually a much shorter reproduction case is just
(< 1 nil)
That’s a bug in elisp I think. It’s in the buffer trying to render the frame
I'd buy that. :)
The error message you are posting there is an emacs logged message, not from clojure
You mean from *Messages*
?
There’s a jvm argument to not omit stacktraces on npe. Wondering if you could add that and see
I'm more than happy to add JVM arguments. :)
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.
Looks like :jvm-opts
in the map.
@dpsutton Do you happen to know the option off the top of your head?
Looks like maybe -XX:-OmitStackTraceInFastThrow
Yeah I think so
đź’Ą
That did it.
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.
Actually it sounds like maybe I'm just straight up not passing the option down to the JVM.
I certainly don't see it on the CL as per pgrep -fla java
.
Yep. I need to make an aliases map.
LOL. This feels slightly less than fully documented…
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.Ok so that’s an issue to open. Cider barfs on errors where the stack trace is omitted
On this board, yes? https://github.com/clojure-emacs/cider/issues