once the compiler pops the dynamic classloader from the stack, attempts to read record reader literals will fail

Description

reproduction case

result

what happens is the evaluator pushes a dynamicclassloader, evaluates some code, then -m foo.bar causes foo.bar/-main to be called, which tries to read in a literal for the just defined record, but it fails because when foo.bar/-main is called clojure.lang.Compiler/LOADER is unbound so RT uses the sun.misc classloader to try and find the class, which it knows nothing about

Approaches: If the patch 0001-CLJ-979-make-clojure-resolve-to-the-correct-Class-in-v2.patch for were to be committed, this issue would be automatically fixed aswell and the patch attached to this ticket would be unnecessary.
Alternatively, the attached patch (0001-CLJ-1457-ensure-Compiler.LOADER-is-bound-while-readi.patch) simply forces a DynamicClassLoader to be bound to clojure.lang.Compiler/LOADER during reading.

Environment

None

Activity

Show:
Michael Fogleman
November 13, 2014, 2:29 PM

In the other issue, Lars Bohl has a reproducible example of a very simple or even simplest possible case.

Alex Miller
December 4, 2014, 6:46 PM

Possibly related:

Nicola Mometto
December 4, 2014, 8:31 PM

The patch 0001-CLJ-979-make-clojure-resolve-to-the-correct-Class-in-v2.patch from contains a workaround that fixes this bug.

Nicola Mometto
December 7, 2014, 12:26 AM

For completeness here's an alternative patch to the one proposed for that fixes this issue by ensuring Compiler/LOADER is bound to a DynamicClassLoader while reading

Alex Miller
January 9, 2015, 4:54 PM

Since is headed into 1.7.0-alpha5, I'm duping this to that.

Assignee

Unassigned

Reporter

Kevin Downey

Labels

Approval

Triaged

Patch

Code

Priority

Minor
Configure