RFR: 8282712: VMConnection.open() does not detect if VM failed to be created, resulting in NPE

Serguei Spitsyn sspitsyn at openjdk.org
Mon Aug 14 23:51:06 UTC 2023


On Sat, 12 Aug 2023 03:56:05 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> VMConnection.open() expects launchTarget(), attachTarget(), and listentTarget() to either throw an exception or return a valid VirtualMachine instance. Instead they were catching certain exceptions and returning null, which resulted in an NPE in VMConnection.open(). I've fixed it so these APIs now rethrow any caught exception and never return null.
> 
> Tested with tier1 and also running the following 10x each on linux-x64, macosx-aarch64, and windows-x64:
> 
> test/hotspot/jtreg/vmTestbase/nsk/jdwp/
> test/hotspot/jtreg/vmTestbase/nsk/jdb/
> test/hotspot/jtreg/vmTestbase/nsk/jdi
> test/jdk/com/sun/jdi

Looks okay.
Should the bug have the label "noreg-self"?
Thanks,
Serguei

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

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15255#pullrequestreview-1577805050


More information about the serviceability-dev mailing list