battleblow / openjdk-jdk11u

BSD port of OpenJDK 11
GNU General Public License v2.0
9 stars 8 forks source link

Process destruction throws an exception on FreeBSD #60

Closed battleblow closed 5 years ago

battleblow commented 5 years ago

The following program

public
class ProcessDestroy {
    public static void main(String[] args) {
        ProcessHandle.current().children().forEach(ProcessHandle::destroy);
    }
}

will throw

Exception in thread "main" java.lang.RuntimeException: Not a directory
    at java.base/java.lang.ProcessHandleImpl.getProcessPids0(Native Method)
    at java.base/java.lang.ProcessHandleImpl.children(ProcessHandleImpl.java:423)
    at java.base/java.lang.ProcessHandleImpl.children(ProcessHandleImpl.java:402)
    at ProcessDestroy.main(ProcessDestroy.java:4)

This causes a number of the inbuilt tests to fail. For example, test/jdk/java/lang/ProcessHandle/Basic.java

battleblow commented 5 years ago

Testing a potential fix

battleblow commented 5 years ago

Looks good so far. Will run all the affected test cases tomorrow to verify.

battleblow commented 5 years ago

Fixes the following tests:

battleblow commented 5 years ago

Fix pushed