TravaOpenJDK / trava-jdk-11-dcevm

dcevm-11 built on Travis
Apache License 2.0
406 stars 56 forks source link

MainKt: Exception while reloading classes : com.sun.jdi.VMDisconnectedException : null #24

Closed 2x2xplz closed 4 years ago

2x2xplz commented 4 years ago

First, thanks in advance for your work on this project, it's normally a huge timesaver.

My latest Kotlin project (Gradle, using IntelliJ 2020.1 on Windows 10) runs on the TravaOpenJDK v.11 DCEVM distro. Unfortunately my classes fail to recompile via hotswap. The specific error (in the pink box) is MainKt: Exception while reloading classes : com.sun.jdi.VMDisconnectedException : null

I have completely uninstalled IntelliJ then re-installed. I was able to get hotswapping to work with a very simple project. But once I rebuilt my main project, it failed again exactly the same. I have tried removing each individual dependency but am unable to isolate the problem.

I'd prefer not to post the entire hs_err_pid crash log, but selected sections are below, I can add more if it would help. Thanks again.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffa0851e366, pid=8532, tid=11908
#
# JRE version: OpenJDK Runtime Environment (11.0.6+1) (build 11.0.6+1-202004131022)
# Java VM: Dynamic Code Evolution 64-Bit Server VM (11.0.6+1-202004131022, mixed mode, tiered, compressed oops, serial gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0x45e366]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-build/issues
#

---------------  S U M M A R Y ------------

Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:52166,suspend=y,server=n -javaagent:C:\Users\XXXX\AppData\Local\JetBrains\IdeaIC2020.1\groovyHotSwap\gragent.jar -javaagent:C:\Users\XXXX\AppData\Local\JetBrains\IdeaIC2020.1\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 api.MainKt

Host: Intel(R) Core(TM) i5-4310U CPU @ 2.00GHz, 4 cores, 15G,  Windows 10 , 64 bit Build 18362 (10.0.18362.778)
Time: Sun May  3 20:16:22 2020 Pacific Daylight Time elapsed time: 18 seconds (0d 0h 0m 18s)

---------------  T H R E A D  ---------------

Current thread (0x000001eaf9540000):  JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=11908, stack(0x0000005a2ba00000,0x0000005a2bb00000)]

Stack: [0x0000005a2ba00000,0x0000005a2bb00000],  sp=0x0000005a2bafe9e0,  free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x45e366]
V  [jvm.dll+0x45f753]
V  [jvm.dll+0x45f034]
V  [jvm.dll+0x71eba7]
V  [jvm.dll+0x49f781]
V  [jvm.dll+0x462e82]
C  [jdwp.dll+0xa1bc]

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000
Java Threads: ( => current thread )
  0x000001eaedb07000 JavaThread "main" [_thread_blocked, id=7964, stack(0x0000005a2b000000,0x0000005a2b100000)]
  0x000001eaf91b2800 JavaThread "Reference Handler" daemon [_thread_blocked, id=16548, stack(0x0000005a2b200000,0x0000005a2b300000)]
  0x000001eaf91b5000 JavaThread "Finalizer" daemon [_thread_blocked, id=10872, stack(0x0000005a2b300000,0x0000005a2b400000)]
  0x000001eaf9216800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7788, stack(0x0000005a2b400000,0x0000005a2b500000)]
  0x000001eaf9217800 JavaThread "Attach Listener" daemon [_thread_blocked, id=10476, stack(0x0000005a2b500000,0x0000005a2b600000)]
  0x000001eaf921a800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=16752, stack(0x0000005a2b600000,0x0000005a2b700000)]
  0x000001eaf9279800 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=2208, stack(0x0000005a2b700000,0x0000005a2b800000)]
  0x000001eaf91cb000 JavaThread "Sweeper thread" daemon [_thread_blocked, id=16544, stack(0x0000005a2b800000,0x0000005a2b900000)]
  0x000001eaf9480000 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=3252, stack(0x0000005a2b900000,0x0000005a2ba00000)]
=>0x000001eaf9540000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=11908, stack(0x0000005a2ba00000,0x0000005a2bb00000)]
  0x000001eaf9542000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=12052, stack(0x0000005a2bb00000,0x0000005a2bc00000)]
  0x000001eaf955a000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=8216, stack(0x0000005a2bc00000,0x0000005a2bd00000)]
  0x000001eafa042000 JavaThread "FileSystemWatchService" daemon [_thread_in_native, id=6468, stack(0x0000005a2be00000,0x0000005a2bf00000)]
  0x000001eafa0da000 JavaThread "HotSwap Watcher" daemon [_thread_blocked, id=1316, stack(0x0000005a2bf00000,0x0000005a2c000000)]
  0x000001eafa0db000 JavaThread "HotSwap Dispatcher" daemon [_thread_blocked, id=15600, stack(0x0000005a2c000000,0x0000005a2c100000)]
  0x000001eafa0dc000 JavaThread "Thread-2" daemon [_thread_blocked, id=17108, stack(0x0000005a2c100000,0x0000005a2c200000)]
  0x000001eafa0cc000 JavaThread "Service Thread" daemon [_thread_blocked, id=11924, stack(0x0000005a2c200000,0x0000005a2c300000)]
  0x000001eaf9b00000 JavaThread "cache_cleaner" [_thread_blocked, id=16588, stack(0x0000005a2bd00000,0x0000005a2be00000)]
  0x000001eafc19c800 JavaThread "XNIO-1 I/O-1" [_thread_in_native, id=3892, stack(0x0000005a2c500000,0x0000005a2c600000)]
  0x000001ea8fdd1000 JavaThread "XNIO-1 I/O-2" [_thread_in_native, id=4248, stack(0x0000005a2c600000,0x0000005a2c700000)]
  0x000001eafbaff800 JavaThread "XNIO-1 I/O-3" [_thread_in_native, id=1796, stack(0x0000005a2c700000,0x0000005a2c800000)]
  0x000001ea8fed4000 JavaThread "XNIO-1 I/O-4" [_thread_in_native, id=16188, stack(0x0000005a2c800000,0x0000005a2c900000)]
  0x000001ea8fed4800 JavaThread "XNIO-1 Accept" [_thread_in_native, id=4684, stack(0x0000005a2c900000,0x0000005a2ca00000)]

Other Threads:
  0x000001eaf9189800 VMThread "VM Thread" [stack: 0x0000005a2b100000,0x0000005a2b200000] [id=16888]
  0x000001eafa0cd000 WatcherThread [stack: 0x0000005a2c300000,0x0000005a2c400000] [id=12884]

Threads with active compile tasks:

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0x000001eaedb04fb0] EnhancedRedefineClasses_lock - owner thread: 0x000001eaf9540000

Heap address: 0x0000000701600000, size: 4074 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
Narrow klass base: 0x0000000800000000, Narrow klass shift: 0
Compressed class space size: 1073741824 Address: 0x0000000800000000
Internal exceptions (20 events):
Event: 3.239 Thread 0x000001eaedb07000 Exception <a 'java/lang/ClassNotFoundException'{0x00000007032246b8}: javax/smartcardio/CardPermission> (0x00000007032246b8) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/openjdk-build/workspace/build/src/src/hotspot/share/classfile/syst
Event: 3.243 Thread 0x000001eaedb07000 Exception <a 'java/io/FileNotFoundException'{0x0000000703241788}> (0x0000000703241788) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/openjdk-build/workspace/build/src/src/hotspot/share/prims/jni.cpp, line 616]
Event: 3.388 Thread 0x000001eaedb07000 Implicit null exception at 0x000001ea87afab17 to 0x000001ea87afb0a6
Event: 3.388 Thread 0x000001eaedb07000 Implicit null exception at 0x000001ea87af2097 to 0x000001ea87af263e
Event: 3.398 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x0000000701daea40}: 'org.slf4j.impl.StaticMDCBinder org.slf4j.impl.StaticMDCBinder.getSingleton()'> (0x0000000701daea40) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/openjdk-build/workspace/b
Event: 3.696 Thread 0x000001eaedb07000 Implicit null exception at 0x000001ea87b6f2a3 to 0x000001ea87b6f4b0
Event: 3.867 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x00000007041f95a8}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object)'> (0x00000007041f95a8) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/op
Event: 3.868 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x00000007041ff120}: 'void java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object)'> (0x00000007041ff120) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/o
Event: 3.883 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x0000000704361f58}: 'void java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'> (0x0000000704361f58) thrown at [c:/Us
Event: 4.293 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x0000000701dabfc0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, int, int, int, int)'> (0x0000000701dabfc0) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-
Event: 4.818 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x00000007020144d0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, int, int, int, int)'> (0x00000007020144d0) thrown at [c:/Users/travis/build/T
Event: 4.834 Thread 0x000001eaedb07000 Exception <a 'java/lang/ClassNotFoundException'{0x00000007020d2268}: sun/nio/ch/PollSelectorImpl> (0x00000007020d2268) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/openjdk-build/workspace/build/src/src/hotspot/share/classfile/systemDic
Event: 4.881 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x0000000702471330}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object)'> (0x0000000702471330) thrown at [c:/Users/travis/build/Tra
Event: 4.887 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x00000007024a9148}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeInterface(java.lang.Object, java.lang.Object)'> (0x00000007024a9148) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/ope
Event: 4.887 Thread 0x000001eaedb07000 Exception <a 'java/lang/IncompatibleClassChangeError'{0x00000007024abee0}: Found class java.lang.Object, but interface was expected> (0x00000007024abee0) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/openjdk-build/workspace/build/src/sr
Event: 4.951 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x000000070276d938}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang
Event: 4.955 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x0000000702793aa8}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang
Event: 4.960 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x00000007027bade0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang
Event: 4.964 Thread 0x000001eaedb07000 Exception <a 'java/lang/NoSuchMethodError'{0x00000007027e3ab8}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang
Event: 18.212 Thread 0x000001eaf9540000 Exception <a 'java/lang/ClassFormatError'{0x00000007034395b0}: Absent Code attribute in method that is not native or abstract in class file api/HikariConnPool> (0x00000007034395b0) thrown at [c:/Users/travis/build/TravaOpenJDK/trava-jdk-11-dcevm/openjdk-b

Events (20 events):
Event: 5.159 loading class kotlinx/serialization/cbor/Cbor$CborListWriter done
Event: 5.160 loading class kotlin/io/FilesKt
Event: 5.160 loading class kotlin/io/FilesKt done
Event: 5.161 loading class kotlin/io/FilesKt__UtilsKt
Event: 5.161 loading class kotlin/io/FilesKt__UtilsKt done
Event: 5.161 loading class kotlin/io/FilesKt__FileTreeWalkKt
Event: 5.161 loading class kotlin/io/FilesKt__FileTreeWalkKt done
Event: 5.162 loading class kotlin/io/FilesKt__FileReadWriteKt
Event: 5.162 loading class kotlin/io/FilesKt__FileReadWriteKt done
Event: 5.162 loading class kotlin/io/FilesKt__FilePathComponentsKt
Event: 5.162 loading class kotlin/io/FilesKt__FilePathComponentsKt done
Event: 5.164 loading class java/io/FileOutputStream$1
Event: 5.164 loading class java/io/FileOutputStream$1 done
Event: 5.575 Thread 0x000001eafba9e800 Thread exited: 0x000001eafba9e800
Event: 9.657 Loaded shared library E:\Java\JDK\java11-openjdk-dcevm-windows\dcevm-11.0.6+1\bin\java.dll
Event: 9.659 Loaded shared library E:\Java\JDK\java11-openjdk-dcevm-windows\dcevm-11.0.6+1\bin\java.dll
Event: 9.660 Loaded shared library E:\Java\JDK\java11-openjdk-dcevm-windows\dcevm-11.0.6+1\bin\java.dll
Event: 9.661 Loaded shared library E:\Java\JDK\java11-openjdk-dcevm-windows\dcevm-11.0.6+1\bin\java.dll
Event: 18.212 loading class java/lang/ClassFormatError
Event: 18.212 loading class java/lang/ClassFormatError done
skybber commented 4 years ago

According logs it crashed in jdwp. Does it mean, you've been upgrading from j8 to j11 and have this problem now or you've been using j11 for some time successfully and have problem on this specific project?

2x2xplz commented 4 years ago

This was a new project, when running on standard OpenJDK 11 I got this error in IntelliJ when I try to Recompile my class (the only change is to a String):

Hot Swap failed. 
MainKt: class not in class file format 
MainKt: Class format error : class not in class file format

After this error, I tried to run with the TravaJDK. Unfortunately hotswapping also failed, with the com.sun.jdi.VMDisconnectedException : null error and log listed above.

Thanks again for the help.

skybber commented 4 years ago

If you make simple class modification - change method body, no method or field addition/removal even the hotswap in standard JVM should work. I don't have Idea neither am I Kotlin programmer, but it looks like problem in your setup, since many are using HA+dcevm11 for Kotlin development.

2x2xplz commented 4 years ago

Agreed, the fault is not with dcevm. Was hoping the logs would help pinpoint an incompatible dependency or help determine what code might be triggering the failure.

Thanks.

2x2xplz commented 4 years ago

Just a follow up, I made some architecture changes to my project, including splitting it into 3 modules. No major changes to the code or to dependencies, however. Good news, all 3 can successfully be hotswapped with TravaJDK/DCEVM.