diff -r abf6ee4c477c -r 3bc26ffdf001 src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java --- a/src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java Thu Aug 22 10:43:25 2019 -0400 +++ b/src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java Thu Aug 22 10:40:34 2019 -0700 @@ -59,8 +59,11 @@ int pid; try { pid = Integer.parseInt(vmid); + if (pid < 1) { + throw new NumberFormatException(); + } } catch (NumberFormatException x) { - throw new AttachNotSupportedException("Invalid process identifier"); + throw new AttachNotSupportedException("Invalid process identifier: " + vmid); } // Find the socket file. If not found then we attempt to start the