On Thu, 7 Mar 2024 17:13:12 GMT, Elif Aslan <d...@openjdk.org> wrote:

>> This change is intended to address the segmentation fault issue that occurs 
>> when jspawnhelper is called without arguments,.
>> There is a new test added  to verify the behavior in such cases.
>> 
>> `[ec2-user@ip-172-16-0-10 jdk]$ make CONF=linux-x86_64-server-fastdebug test 
>> TEST=test/jdk/java/lang/ProcessBuilder/JspawnhelperWarnings.java`
>> 
>> 
>> 
>> ==============================
>> Test summary
>> ==============================
>>    TEST                                              TOTAL  PASS  FAIL ERROR
>>    jtreg:test/jdk/java/lang/ProcessBuilder/JspawnhelperWarnings.java
>>                                                          1     1     0     0
>> ==============================
>> TEST SUCCESS
>
> Elif Aslan has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add args[0] back

test/jdk/java/lang/ProcessBuilder/JspawnhelperWarnings.java line 29:

> 27:  * @test
> 28:  * @bug 8325567
> 29:  * @requires (os.family == "linux") | (os.family == "aix")

Unless I'm mistaken, jspawn helper is used on Mac as well.

test/jdk/java/lang/ProcessBuilder/JspawnhelperWarnings.java line 36:

> 34: import java.nio.file.Paths;
> 35: import java.util.Arrays;
> 36: import java.util.concurrent.TimeUnit;

Unused import.

test/jdk/java/lang/ProcessBuilder/JspawnhelperWarnings.java line 56:

> 54:     public static void main(String[] args) throws Exception {
> 55:         for (int nArgs = 0; nArgs < 10; nArgs++) {
> 56:             tryWithNArgs(nArgs);

Running with more than 3 arguments is unnecessary. Yes, its quick but just 
burns cpu.

When running with 2 arguments, the failure mode is not due to the number of 
arguments but is because argument 1 is formatted incorrectly;  should be 
`"%d:%d:%d"`. Though I supposed this falls into the "incorrect use category".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18112#discussion_r1516736692
PR Review Comment: https://git.openjdk.org/jdk/pull/18112#discussion_r1516738195
PR Review Comment: https://git.openjdk.org/jdk/pull/18112#discussion_r1516733166

Reply via email to