Integrated: 7902870: Infinite loop in AgentServer
Naoto Sato
naoto at openjdk.java.net
Tue Mar 30 22:41:28 UTC 2021
On Fri, 26 Mar 2021 23:24:37 GMT, Naoto Sato <naoto at openjdk.org> wrote:
> 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.
This pull request has now been integrated.
Changeset: cbeb35fe
Author: Naoto Sato <naoto at openjdk.org>
Committer: Jonathan Gibbons <jjg at openjdk.org>
URL: https://git.openjdk.java.net/jtreg/commit/cbeb35fe
Stats: 8 lines in 1 file changed: 6 ins; 0 del; 2 mod
7902870: Infinite loop in AgentServer
-------------
PR: https://git.openjdk.java.net/jtreg/pull/6
More information about the jtreg-dev
mailing list