-
-
Notifications
You must be signed in to change notification settings - Fork 803
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
byteBuddyAgent installExternal cause jvm hangs #1493
Comments
Normally, the attach should not write data back, but this indeed possible if data is written back. How do you encounter this problem? The issue is that it would require a second thread to read the streams, given Java 5 APIs. But I will see how I can add this as an enhancement. |
@raphw java supports environment variable JAVA_TOOL_OPTIONS which serves the same functionality of -javaagent:xxx.jar . This is an convenient way for us because in some circumstances we cannot modify java startup command easily. Some java agents will write a bit more logs. BytebuddyAgent uses jvm attach(which is itself a java app), so the new java attach Process has also been influenced by JAVA_TOOL_OPTIONS. |
@raphw when will this issue be closed, we encounter this problem too |
@raphw I'm seeing this too. Here's a sample:
Of note could be the different JVM versions. I compiled this with java 11 but it's running in a java 17 JVM. I wonder if there's something going on there? |
It should be compatible, but it's not guaranteed as far as I know. |
Method of installExternal will create subProcess using ProcessBuilder.start(), and wait for subProcess to return.
SubProcess can of course write data, but when it writes relative more data, eg 64K, it can't write more because parent process does not read the data out. Since Parent process is waiting sub process to return, jvm got stuck.
Should ProcessBuilder in installExternal redirect stdout and stderr to null or start threads to consume the written data?
The text was updated successfully, but these errors were encountered: