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

Trouble to attach with high PID value #89

Open
ymartin59 opened this issue Nov 27, 2020 · 1 comment
Open

Trouble to attach with high PID value #89

ymartin59 opened this issue Nov 27, 2020 · 1 comment

Comments

@ymartin59
Copy link

I am facing this issue with trying to load agent into JVM when system process PID out of integer range:

/usr/lib/jvm/java-8-oracle/bin/java -cp attach-main.jar:/usr/lib/jvm/java-8-oracle/lib/tools.jar net.virtualvoid.perf.AttachOnce 115323
Exception in thread "main" java.io.IOException: Non-numeric value found - int expected
	at sun.tools.attach.HotSpotVirtualMachine.readInt(HotSpotVirtualMachine.java:299)
	at sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:63)
	at sun.tools.attach.HotSpotVirtualMachine.loadAgentPath(HotSpotVirtualMachine.java:88)
	at net.virtualvoid.perf.AttachOnce.loadAgent(AttachOnce.java:51)
	at net.virtualvoid.perf.AttachOnce.main(AttachOnce.java:34)

Is there any other work-around than reboot Linux?

Generally speaking, is this "integer" PID restriction for hotspot VM attachment has been fixed in any recent Java 8 or OpenJDK version?

@jrudolph
Copy link
Member

When I saw error like this the last time, it was a mismatch between the target JDK and the tools.jar. The attach protocol is not guaranteed to be compatible between JDKs.

For me using "long" (> 65536) PIDs works in general.

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

2 participants