In AgentServer.java, there is this piece of code:
private void decode() throws IOException {
byteBuffer.flip();
CoderResult cr;
while ((cr = decoder.decode(byteBuffer, charBuffer, false)) != CoderResult.UNDERFLOW) {
writeCharBuffer();
}
byteBuffer.compact();
}
The while loop only exits if the decode() returns UNDERFLOW, which may not be true in some occasions, because the encoding used here and the output from the agent VM may differ, decode() may return malformed/unmapped error. Then it will become an infinite loop here.
private void decode() throws IOException {
byteBuffer.flip();
CoderResult cr;
while ((cr = decoder.decode(byteBuffer, charBuffer, false)) != CoderResult.UNDERFLOW) {
writeCharBuffer();
}
byteBuffer.compact();
}
The while loop only exits if the decode() returns UNDERFLOW, which may not be true in some occasions, because the encoding used here and the output from the agent VM may differ, decode() may return malformed/unmapped error. Then it will become an infinite loop here.
- blocks
-
JDK-8260265 UTF-8 by Default
-
- Resolved
-