Closed tico-tico closed 5 years ago
Do javac
and java
run OK?
Also are dt_socket.dll
and dt_shmem.dll
in the $JAVA_HOME/bin/ directory or anywhere else on your PC?
Do
javac
andjava
run OK?
Yes, i should have mentioned it, sorry.
Also are
dt_socket.dll
anddt_shmem.dll
in the $JAVA_HOME/bin/ directory or anywhere else on your PC?
Yes, they are in bin, 32-bit dlls.
@ali-ince I'll pass this over to you if that's OK - would be interested to know if you have the same error locally
I can reproduce the issue on my local computer as well. It seems it's related with exported symbol names on dll's, that's the main difference on 32-bit and 64-bit dt_socket.dll
.
I'll try to figure out what causes this difference.
I can reproduce the issue on my local computer as well. It seems it's related with exported symbol names on dll's, that's the main difference on 32-bit and 64-bit
dt_socket.dll
.I'll try to figure out what causes this difference.
Yep, just for fun I using hex-editor changed jdwpTransport_OnLoad
to _jdwpTransport_OnLoad@16
in jdwp.dll and now jshell runs OK.
I can reproduce the issue on my local computer as well. It seems it's related with exported symbol names on dll's, that's the main difference on 32-bit and 64-bit
dt_socket.dll
. I'll try to figure out what causes this difference.Yep, just for fun I using hex-editor changed
jdwpTransport_OnLoad
to_jdwpTransport_OnLoad@16
in jdwp.dll and now jshell runs OK.
Oh, nice find!
OK, i did some reading. It turns out that C-function names are decorated by VS only for x86 and not for x64, thats why we have the issue. See here https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/x7kb4e2f(v%3dvs.110) .
Simplest workaround is to patch openjdk-jdk11/src/jdk.jdwp.agent/share/native/libjdwp/transport.c
*** transport-orig.c 2018-11-12 17:01:23.154284000 +0300
--- transport.c 2018-11-12 17:00:17.630930200 +0300
*************** findTransportOnLoad(void *handle)
*** 96,102 ****
--- 96,106 ----
return onLoad;
}
onLoad = (jdwpTransport_OnLoad_t)
+ #if defined(_MSC_VER) && defined(_M_IX86)
+ dbgsysFindLibraryEntry(handle, "_jdwpTransport_OnLoad@16");
+ #else
dbgsysFindLibraryEntry(handle, "jdwpTransport_OnLoad");
+ #endif
return onLoad;
}
Sorry, i can't test it myself, consider it as a hint.
@ali-ince If you're able to lest this then I think we can submit a patch upstream.
@tico-tico, @karianna I've created a PR for JDK11 which doesn't change the source code but fixes the exported function name to be jdwpTransport_OnLoad
.
sorry for getting back to this late.
@karianna the upstream patch has already been merged into jdk 13 (https://bugs.openjdk.java.net/browse/JDK-8214122). Similar to #763, could you please point me in the right direction to get a backport into jdk12/11?
@ali-ince Looks like Christopher Langer is backporting to 11u - https://bugs.openjdk.java.net/browse/JDK-8214122 - if you comment on the jdk-updates mailing list at OpenJDK, reference this issue number and ask Christopher if he'll also backport to 12 (and offer to do so if he doesn't) then that should get this through - thanks!
This is already fixed in upstream jdk11u and now it’s also applied into jdk12u which will be included in a later release as well.
I’ve created a revert PR of our initial fix as well.
Closing this issue.
hello, the same problem has occured on my Mac:
➜ ~ jshell
Launching JShell execution engine threw: ERROR: transport error 202: handshake failed - connection prematurally closed
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [./open/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:732]
tested env:
jdk 11.0.9
macos 10.15.7
@MagicZer0 That problem happened on Windows. macOS is a different beast. Please open a new ticket https://github.com/adoptopenjdk/openjdk-support and provide additional details. I tried to launch jshell from 11.0.9 and it's working for me.
I'm not sure whether it's a known issue or not. Tried nightly 01-11-2018 on Windows 7 Home, SP1, 32-bit.