RFR 8239893: Windows handle Leak when starting processes using ProcessBuilder
Roger.Riggs at oracle.com
Fri Mar 6 16:17:32 UTC 2020
I don't think getting handle count of your own process can ever fail.
But in the abundance of caution, added a check and failure.
On 3/5/20 4:14 PM, naoto.sato at oracle.com wrote:
> Hi Roger,
> In the test, the error value (-1) from the native code seems silently
> suppressed. Should it be caught/reported in the java side?
> nit: copyright year in ProcessImpl.java -> 2020.
> On 3/5/20 12:51 PM, Roger Riggs wrote:
>> Please review a change to the Windows ProcessImpl to ensure that the
>> created for the input and output streams of a process are closed when
>> no longer referenced.
>> Unlike on Linux, there is no thread monitoring the process that can
>> close the streams.
>> The FileDescriptors are registered with the Cleaner to be closed when
>> they are no longer referenced.
>> A test is added that monitors the count of handles as 50 Processes
>> are launched and exit.
>> The test and change only affect the Windows implementation.
>> Thanks, Roger
More information about the core-libs-dev