Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reliable JVM crash using definterface+ #57

Open
glchapman opened this issue Oct 22, 2018 · 4 comments
Open

Reliable JVM crash using definterface+ #57

glchapman opened this issue Oct 22, 2018 · 4 comments

Comments

@glchapman
Copy link

I'm not sure if this is properly a Potemkin, Clojure, or JVM bug, but I thought I'd start by reporting it here. Please let me know if you think it belongs elsewhere. Anyway, I can reliably crash JVM 11.0.1 on Windows 10 with the attached clojure file (this works with Clojure 1.10 betas 2 and 3 as well as Clojure 1.9). At the repl, I require the temp.clj and run show-bug -- everything is fine. But then I require it again (using :reload true) and run show-bug and the JVM crashes producing the attached error report.
jvmcrash.zip

@ztellman
Copy link
Collaborator

Ha, wow. I'll dig into this and let you know if I can figure anything out.

@glchapman
Copy link
Author

A few more datapoints:

  1. this also crashes JVM 11 on Linux (Ubuntu 14 provided by the Windows Subystem for Linux) -- I've attached another error report.
    jvmcrash_linux.zip
  2. I think the crash is happening in the final checkcast to Thing in thing-at. After removing that typehint from the IContainer interface, the crash goes away.
  3. I can also get rid of the crash by removing the "already exists" check in definterface+ (so that the macro always emits a definterface). This works even when IContainer includes the Thing typehint.

@ztellman
Copy link
Collaborator

Interesting. The third item suggests to me that the original interface may be getting GCed from permgen, even though it's still referenced. I still haven't had a chance to look at this, but this is very helpful, thank you.

@KingMob
Copy link
Contributor

KingMob commented Oct 4, 2022

Not 100% sure it's related, but there's still an error of some sort., albeit, not a crash.

In JDK 17, Clojure 1.11.1, after reloading and rerunning show-bug, I get:

Execution error (LinkageError) at temp.Container/thing_at (temp.clj:11).
loader constraint violation: loader clojure.lang.DynamicClassLoader @194cd536 wants to load class temp.Thing. A different class with the same name was previously loaded by clojure.lang.DynamicClassLoader @4e13bf71. (temp.Thing is in unnamed module of loader clojure.lang.DynamicClassLoader @4e13bf71, parent loader clojure.lang.DynamicClassLoader @6e1630dc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants