On Wed, 23 Feb 2022 09:46:28 GMT, Ichiroh Takiguchi <[email protected]>
wrote:
>> Run jtreg:jdk/java/lang/ProcessBuilder/Basic.java on AIX.
>> The test was failed by:
>> Incorrect handling of envstrings containing NULs
>>
>> According to my investigation, this issue was happened after following
>> change was applied.
>> JDK-8272600: (test) Use native "sleep" in Basic.java
>>
>> test.nativepath value was added into AIX's LIBPATH during running this
>> testcase.
>> On AIX, test.nativepath value should be removed from LIBPATH value before
>> comparing the values.
>
> Ichiroh Takiguchi has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Change LIBPATH usage
test/jdk/java/lang/ProcessBuilder/Basic.java line 85:
> 83: if (AIX.is()) {
> 84: String nativepath = System.getProperty("test.nativepath");
> 85: if (nativepath != null) {
I think this null check should be modified. There are two issues at play.
- If nativepath is null it will be caught by the filter below. So it is safe to
pass it past this point in either case (null or non-null).
- If libpathString is null there will be a NullPointerException when split gets
called on it below.
I believe there are at least two reasonable choices here. The first is to
change nativepath -> libpathString in this null check. This option guards
against calling String.split on a null value. Alternatively, you could trust
that since this code doesn't get called unless AIX.is() returns true, that it's
safe to remove this check altogether. This second option is only viable if we
know LIBPATH is always set on AIX.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7574