Fork me on GitHub
#clojure-dev
<
2019-02-20
>
thheller09:02:03

any hints on what may cause this?

ClassCastException: clojure.lang.KeywordLookupSite$1 incompatible with clojure.lang.IFn
        clojure.spec.alpha/spec-impl/reify--1987 (alpha.clj:875)
        clojure.spec.alpha/conform (alpha.clj:150)
        clojure.spec.alpha/conform (alpha.clj:146)
        clojure.spec.alpha/macroexpand-check (alpha.clj:685)
        clojure.spec.alpha/macroexpand-check (alpha.clj:681)
        clojure.lang.Var.invoke (Var.java:385)
        cljs.analyzer/do-macroexpand-check (analyzer.cljc:3312)
        cljs.analyzer/do-macroexpand-check (analyzer.cljc:3306)
        cljs.analyzer/macroexpand-1* (analyzer.cljc:3326)
        cljs.analyzer/macroexpand-1* (analyzer.cljc:3314)
        cljs.analyzer/macroexpand-1 (analyzer.cljc:3375)
        cljs.analyzer/macroexpand-1 (analyzer.cljc:3371)
        cljs.analyzer/analyze-seq (analyzer.cljc:3408)
        cljs.analyzer/analyze-seq (analyzer.cljc:3388)

thheller09:02:20

never seen this problem before and don't know where to start looking https://github.com/thheller/shadow-cljs/issues/443

andy.fingerhut15:02:01

@thheller Given that it is ClojureScript, you may also want to check in #cljs-dev channel

thheller15:02:20

thx but I'm quite familiar with the CLJS side of things, this seems to be something on the CLJ side

Alex Miller (Clojure team)16:02:46

but smells classloadery to me

Alex Miller (Clojure team)16:02:05

like a fn compiled with IFn from a different classloader

bronsa16:02:10

it's leaking an inner class of KLS

bronsa16:02:34

something is invoking this object as a function

bronsa16:02:47

a bad implementation of ILookupSite

bronsa16:02:02

or whichever of those interfaces you need to implement :)

bronsa16:02:19

I can never remember

ghadi16:02:15

this is the second time I've seen this in a couple weeks

bronsa16:02:35

either that, or there's something broken in the inline keyword lookup cache

mikerod16:02:37

I’ve seen an error like this “bad lookup site” before

ghadi16:02:38

same "impossible" situation with the innards of a KLS

mikerod16:02:45

discussed it inthis channel to

bronsa16:02:50

but that would be really surprising to me

mikerod16:02:03

with @ghadi contributing to that discussion before too I think - not sure what I had before and think we never found the answer

mikerod16:02:43

but don’t think it had anything to do with cljs and wasn’t using shadow I’m sure

bronsa16:02:06

@ghadi I mean it's not really an impossible situation, just impossible provided you're not handling KLS manually I think?

bronsa16:02:27

you can access that thunk using fault

mikerod16:02:34

I wasn’t doing anything weird

mikerod16:02:40

a kw site was just failing magically

bronsa16:02:47

interesting

mikerod16:02:51

wasn’t trying to get down and manually call the callsite thunk or anything

ghadi16:02:58

^ that's all I need -- user wasn't doing anything weird

ghadi16:02:02

need a repro case

mikerod16:02:11

well, obviously you do, hah

ghadi16:02:24

could tooling be doing weird things?

mikerod16:02:25

just saying “hey, I’ve saw this and tried to discuss similar recently”

ghadi16:02:26

seriously thank you for chiming in - I couldn't remember the details

mikerod16:02:36

ah, was clara-rules and core.async in my case

mikerod16:02:44

so there were threads involved

mikerod16:02:47

and that’s all I ever knew

ghadi16:02:00

common tooling maybe? CIDER etc?

mikerod16:02:06

and we thought - perhaps the record type was being redef’ed so hitting the non-`identical?` branch of the callsite check

bronsa16:02:24

but that shouldn't leak

bronsa16:02:40

the bytecode the compiler emits should handle that case cleanly

bronsa16:02:51

it's very strange

mikerod16:02:02

not sure on tooling, it was actually a reported problem I was trying to diagnose. so yeah, not adding enough useful info here sadly.

mikerod16:02:15

I was surprised at it being able to leak at all though indeed.

mikerod16:02:44

I tried for a while at the repl to manipulate things enough to cause it, with like redefining things etc, had no success