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

nightly jdk11 Win32 jshell error #709

Closed
tico-tico opened this issue Nov 2, 2018 · 13 comments
Closed

nightly jdk11 Win32 jshell error #709

tico-tico opened this issue Nov 2, 2018 · 13 comments

Comments

@tico-tico
Copy link

@tico-tico tico-tico commented Nov 2, 2018

I'm not sure whether it's a known issue or not. Tried nightly 01-11-2018 on Windows 7 Home, SP1, 32-bit.

C:\Program Files\jdk-11\bin>jshell
Launching JShell execution engine threw: ERROR: transport library missing onLoad entry: dt_socket
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)
JDWP exit error AGENT_ERROR_TRANSPORT_LOAD(196): No transports initialized [:732]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_LOAD(196)
@karianna

This comment has been minimized.

Copy link
Member

@karianna karianna commented Nov 2, 2018

Do javac and java run OK?

@karianna karianna added this to TODO in openjdk-build via automation Nov 2, 2018
@karianna karianna added the bug label Nov 2, 2018
@karianna

This comment has been minimized.

Copy link
Member

@karianna karianna commented Nov 2, 2018

Also are dt_socket.dll and dt_shmem.dll in the $JAVA_HOME/bin/ directory or anywhere else on your PC?

@tico-tico

This comment has been minimized.

Copy link
Author

@tico-tico tico-tico commented Nov 2, 2018

Do javac and java run OK?

Yes, i should have mentioned it, sorry.

Also are dt_socket.dll and dt_shmem.dll in the $JAVA_HOME/bin/ directory or anywhere else on your PC?

Yes, they are in bin, 32-bit dlls.

@karianna

This comment has been minimized.

Copy link
Member

@karianna karianna commented Nov 2, 2018

@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

@ali-ince

This comment has been minimized.

Copy link
Contributor

@ali-ince ali-ince commented Nov 2, 2018

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.

@tico-tico

This comment has been minimized.

Copy link
Author

@tico-tico tico-tico commented Nov 3, 2018

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.

@karianna

This comment has been minimized.

Copy link
Member

@karianna karianna commented Nov 3, 2018

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!

@tico-tico

This comment has been minimized.

Copy link
Author

@tico-tico tico-tico commented Nov 12, 2018

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.

@karianna

This comment has been minimized.

Copy link
Member

@karianna karianna commented Nov 12, 2018

@ali-ince If you're able to lest this then I think we can submit a patch upstream.

@ali-ince

This comment has been minimized.

Copy link
Contributor

@ali-ince ali-ince commented Nov 12, 2018

@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.

@ali-ince

This comment has been minimized.

Copy link
Contributor

@ali-ince ali-ince commented Feb 27, 2019

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?

@karianna

This comment has been minimized.

Copy link
Member

@karianna karianna commented Feb 27, 2019

@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!

@ali-ince

This comment has been minimized.

Copy link
Contributor

@ali-ince ali-ince commented Mar 20, 2019

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.

@ali-ince ali-ince closed this Mar 20, 2019
openjdk-build automation moved this from TODO to Done Mar 20, 2019
@karianna karianna added this to the March 2019 milestone Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
openjdk-build
  
Done
3 participants
You can’t perform that action at this time.