Exceptions thrown in user namespace initialisation in Clojure 1.10.0 are missing the full stacktrace

Description

The cause stack is swallowed when exceptions are thrown during initialization of the user namespace. Compiler exceptions thrown after this point have the full stack trace.

The behavior changed between 1.10 alpha6 and alpha7.

Cause: The changes in CLJ-2373 for CompilerException.toString() use calls to RT. In the scenario above, we are in the path of RT static initialization so RT has not yet been loaded. Thus the toString() logic triggers NoClassDefFoundError while building the message in the toString() of the actual exception.

Approach: Stop using RT.get() in the toString() and use IPersistentMap.valAt() directly.

Patch: clj-2427-2.patch

Environment

None

Activity

Show:
Ghadi Shayban
November 8, 2018, 4:48 PM

Thanks Daniel – I edited the repro case a bit.

Alex Miller
November 13, 2018, 3:29 AM

This is due to the Compiler$CompilerException.toString() change in CLJ-2373, looking at it.

Alex Miller
November 13, 2018, 5:45 PM

-2 fixes some test failures - oops!

Daniel Compton
November 13, 2018, 8:52 PM
Completed

Assignee

Unassigned

Reporter

Daniel Compton

Approval

Ok

Patch

Code

Fix versions

Affects versions

Priority

Major
Configure