JetBrains / JetBrainsRuntime

Runtime environment based on OpenJDK for running IntelliJ Platform-based products on Windows, macOS, and Linux
GNU General Public License v2.0
1.32k stars 196 forks source link

Crash when reloading on `jbr_dcevm-17_0_1-osx-aarch64-b164.8` #102

Closed mworzala closed 2 years ago

mworzala commented 2 years ago

When reloading using dcevm/hotswap agent on jbr_dcevm-17_0_1-osx-aarch64-b164.8, the reload happens and then the JVM crashes immediately. I have attached the crash report, let me know if any other information is helpful.

hs_err_pid17685.log

mworzala commented 2 years ago

Hmm some more context, on a simpler project it does not crash but also does not apply the reloaded changes and prints

HOTSWAP AGENT: 22:34:47.539 ERROR (org.hotswap.agent.plugin.jdk.JdkPlugin) - classReload() exception No such field java.beans.Introspector.declaredMethodCache on null.

in the terminal. This error popped up on the original project as well.

skybber commented 2 years ago

You can ignore the HA error message. HA is not fully ported to java17 now. The crash seems more serious, is it reproducible?

mworzala commented 2 years ago

It’s consistent in one project, doesn’t happen in another. Although in the latter case nothing is reloaded as far as I can tell.

skybber commented 2 years ago

Is it possible to describe steps how to reproduce it on your https://github.com/Minestom/Minestom project?

mworzala commented 2 years ago
  1. git clone https://github.com/Minestom/Minestom
  2. git checkout 529_extension_improvement
  3. (the rest in IntelliJ for convenience)
  4. Project/gradle jdk to JBR
  5. Debug src/test/java/demo/Main with -XX:HotswapAgent=fatjar
  6. Make an edit at src/main/java/net/minestom/server/instance/InstanceContainer#L465 (for example a system print)
  7. Recompile/reload InstanceContainer.java
  8. Crash

This is consistent on my machine. The crash does not seem consistent at other locations. That one always crashes though.

skybber commented 2 years ago

@mworzala thanks for great report. I've fix now for it, it should be included in next release.

skybber commented 2 years ago

@mworzala before patch will be available, you can use -XX:-UseEmptySlotsInSupers as a workaround for your issue.

mworzala commented 2 years ago

Looks like that's working, thanks for the quick responses and patch!

I will close the issue for now, but if you could make a comment when the next release happens that would be great.

avu commented 2 years ago

@skybber why did you reopened this issue? Is it not fixed yet?

skybber commented 2 years ago

already fixed in java17.