clj-commons / byte-streams

A Rosetta stone for JVM byte representations
417 stars 33 forks source link

Heisenbug with graph.clj #25

Closed malcolmsparks closed 7 years ago

malcolmsparks commented 7 years ago

Have been getting the following error, which I can't reproduce on other machines.

I'm noting here just in case others are seeing the same thing.

I have no idea what is causing it, it's caused me a lot of pain this week. Just can't see what the fix is.

CompilerException java.lang.RuntimeException: No such var: s/->source, compiling:(byte_streams/graph.clj:108:64)
ztellman commented 7 years ago

What version? On Fri, Nov 25, 2016 at 8:13 AM Malcolm Sparks notifications@github.com wrote:

Have been getting the following error, which I can't reproduce on other machines.

I'm noting here just in case others are seeing the same thing.

I have no idea what is causing it, it's caused me a lot of pain this week. Just can't see what the fix is.

CompilerException java.lang.RuntimeException: No such var: s/->source, compiling:(byte_streams/graph.clj:108:64)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ztellman/byte-streams/issues/25, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB6P5FEMvzsMtYHadWG4tUOcN-YRbiQks5rBwkogaJpZM4K8khR .

malcolmsparks commented 7 years ago

0.2.2 - but I'm happy closing the issue, I'm convinced I've got some kind of low-level or hardware issue that's to blame

On 25 Nov 2016 23:15, "Zach Tellman" notifications@github.com wrote:

What version? On Fri, Nov 25, 2016 at 8:13 AM Malcolm Sparks notifications@github.com wrote:

Have been getting the following error, which I can't reproduce on other machines.

I'm noting here just in case others are seeing the same thing.

I have no idea what is causing it, it's caused me a lot of pain this week. Just can't see what the fix is.

CompilerException java.lang.RuntimeException: No such var: s/->source, compiling:(byte_streams/graph.clj:108:64)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ztellman/byte-streams/issues/25, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAB6P5FEMvzsMtYHadWG4tUOcN-YRbiQks5rBwkogaJpZM4K8khR .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ztellman/byte-streams/issues/25#issuecomment-263031457, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ9O9Tg3iDZ3Yc5Gw8dAvdZf7ev67xoks5rB2wXgaJpZM4K8khR .

ztellman commented 7 years ago

Is there any AOT compilation going on?

On Sat, Nov 26, 2016 at 4:51 AM Malcolm Sparks notifications@github.com wrote:

0.2.2 - but I'm happy closing the issue, I'm convinced I've got some kind of low-level or hardware issue that's to blame

On 25 Nov 2016 23:15, "Zach Tellman" notifications@github.com wrote:

What version? On Fri, Nov 25, 2016 at 8:13 AM Malcolm Sparks <notifications@github.com

wrote:

Have been getting the following error, which I can't reproduce on other machines.

I'm noting here just in case others are seeing the same thing.

I have no idea what is causing it, it's caused me a lot of pain this week. Just can't see what the fix is.

CompilerException java.lang.RuntimeException: No such var: s/->source, compiling:(byte_streams/graph.clj:108:64)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ztellman/byte-streams/issues/25, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAB6P5FEMvzsMtYHadWG4tUOcN-YRbiQks5rBwkogaJpZM4K8khR .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/ztellman/byte-streams/issues/25#issuecomment-263031457 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAJ9O9Tg3iDZ3Yc5Gw8dAvdZf7ev67xoks5rB2wXgaJpZM4K8khR

.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ztellman/byte-streams/issues/25#issuecomment-263061893, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB6P_xNl0l1pxI4UCObjNyHSin_MwsPks5rCCtZgaJpZM4K8khR .

ztellman commented 7 years ago

There's some conditional compilation stuff going on in Manifold, at https://github.com/ztellman/manifold/blob/master/src/manifold/deferred.clj#L1205 and https://github.com/ztellman/manifold/blob/master/src/manifold/stream.clj#L45, which could throw an exception, which would cause the error you're seeing (it "loads" the namespace, but it's empty because it throws while loading). My guess is something weird there, possibly because it's compiled with JDK 8 and run under JDK 7? Just a guess.

On Sat, Nov 26, 2016 at 2:27 PM Zach Tellman ztellman@gmail.com wrote:

Is there any AOT compilation going on?

On Sat, Nov 26, 2016 at 4:51 AM Malcolm Sparks notifications@github.com wrote:

0.2.2 - but I'm happy closing the issue, I'm convinced I've got some kind of low-level or hardware issue that's to blame

On 25 Nov 2016 23:15, "Zach Tellman" notifications@github.com wrote:

What version? On Fri, Nov 25, 2016 at 8:13 AM Malcolm Sparks <notifications@github.com

wrote:

Have been getting the following error, which I can't reproduce on other machines.

I'm noting here just in case others are seeing the same thing.

I have no idea what is causing it, it's caused me a lot of pain this week. Just can't see what the fix is.

CompilerException java.lang.RuntimeException: No such var: s/->source, compiling:(byte_streams/graph.clj:108:64)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ztellman/byte-streams/issues/25, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAB6P5FEMvzsMtYHadWG4tUOcN-YRbiQks5rBwkogaJpZM4K8khR .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/ztellman/byte-streams/issues/25#issuecomment-263031457 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAJ9O9Tg3iDZ3Yc5Gw8dAvdZf7ev67xoks5rB2wXgaJpZM4K8khR

.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ztellman/byte-streams/issues/25#issuecomment-263061893, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB6P_xNl0l1pxI4UCObjNyHSin_MwsPks5rCCtZgaJpZM4K8khR .

malcolmsparks commented 7 years ago

I've seen the conditional compilation in manifold and I guess it could be related. I have tried with and without core.async in the classpath.

However, this issue only crops up 60% of the time, the other times I start a REPL it is either fine, or other unexpected compilation errors are produced, and they are rarely the same. The only error that seems to come up quite frequently is this No such var: s/->source one.

I've ensured there is no AOT compilation going on, and that the git repo is clean with git clean -fdx. I've upgraded my Leiningen to 2.7.1, deleted my boot cache, deleted my $HOME/.m2/repository entirely (twice!), upgraded my machine (Arch, so latest openjdk 8). There's no java 7 remaining on my machine.

I've run out of ideas what could be causing this. Since it doesn't happen reliably, it's hard to reduce down to a reliably failing test, in fact, when I do so, the issue tends to disappear. I've had the issue with both Clojure 1.8 and Clojure 1.9-alpha14, so it's not related to Clojure version either. I can't think what else to try.

Note, this problem has been happening since last Tuesday, on projects that I haven't worked on for weeks. So it's definitely an issue with my local setup (which is fairly minimal). It does seem to happen more via CIDER. It does feel like a AOT cacheing thing, but I'm stumped as to what to try next. I'm hoping that by publishing some details it might draw in some other suggestions.

ztellman commented 7 years ago

Hmm. Well, I'll keep an eye out for it, and let you know if I figure anything out. Leaving this open for now.

malcolmsparks commented 7 years ago

I've finally managed to reduce the problem down to https://github.com/clojure-emacs/refactor-nrepl

There's an issue here: https://github.com/clojure-emacs/refactor-nrepl/issues/160 - I've determined that the fix mentions doesn't help me, but looking at what refactor-nrepl is doing leads me to think that there's something here that affects the ordering of requiring namespaces which triggers my problem.

Whatever it is, if I avoid loading [refactor-nrepl "2.2.0"] in my .lein/profiles.clj then everything works perfectly again.

Interestingly, the issue is only triggered when both refactor-nrepl is declared and after CIDER in Emacs has connected. The connection from CIDER causes refactor-nrepl to load something that causes the initial compilation of my code graph (via (dev), but no matter), to fail. Oddly, it fails in a number of different ways - it seems non-deterministic.

There's always the chance this issue will trip someone else up, and search engines are fairly good and picking up GitHub issues, so perhaps someone may in future throw some more light on this. In the meantime, I'll link this issue to a new one in https://github.com/clojure-emacs/refactor-nrepl