[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: JDK-8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load 
From:       Alex Menkov <amenkov () openjdk ! org>
Date:       2024-02-26 23:21:52
Message-ID: W3h1viTuWRDw2nClPmEMSg021JfZSvtOK9-cpBUGgWA=.a6a08e7b-ca1e-45ad-b258-1a6a360c17f0 () github ! com
[Download RAW message or body]

On Wed, 21 Feb 2024 21:13:36 GMT, Alex Menkov <amenkov@openjdk.org> wrote:

> VirtualMachine.loadAgentPath/loadAgentLibrary can fail with AgentLoadException in 2 \
>                 cases:
> - attach listener returns error; in the case the exception is thrown from \
> HotSpotVirtualMachine.processCompletionStatus (called from \
>                 HotSpotVirtualMachine.execute);
> - attach listener returns success, but reply does not contain Agent_onAttach return \
> code ("return code: %d" message). 
> before jdk21 if attach listener fails to load required library, it returned error \
> (case 1) from jdk21 attach listener always returns success (case 2)
> Both cases are ok, but for 2nd case HotSpotVirtualMachine.loadAgentLibrary read \
> only single line of the response message, so exception message didn't contain error \
> details. 
> The fix updates HotSpotVirtualMachine.loadAgentLibrary to read the whole response \
> message. Walking through the code, fixed some other minor things in attach listener \
> and attach API implementation (commented in the code) 
> Testing:
> - test/jdk/com/sun/tools;
> - tier1,tier2,tier5-svc

This pull request has now been integrated.

Changeset: fc67c2b4
Author:    Alex Menkov <amenkov@openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/fc67c2b4f17216d4adcc0825d0f378ae4f150025
                
Stats:     150 lines in 6 files changed: 109 ins; 16 del; 25 mod

8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load \
agent library

Reviewed-by: sspitsyn, cjplummer

-------------

PR: https://git.openjdk.org/jdk/pull/17954


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic