RFR: 8286694: Incorrect argument processing in java launcher

2022-05-13 Thread Yasumasa Suenaga
GCC 12 reports as following: - Commit messages: - 8286694: Incorrect argument processing in java launcher Changes: https://git.openjdk.java.net/jdk/pull/8694/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8694&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-16 Thread David Holmes
On Fri, 13 May 2022 08:56:59 GMT, Yasumasa Suenaga wrote: > GCC 12 reports as following: Simply considering the compiler warning shouldn't `(arg+2) == NULL` actually be `arg[2] = '\0'` ? as we are looking to see if this arg is only three characters: '-', 'J' and '\0' - PR: https:

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-16 Thread Yasumasa Suenaga
On Mon, 16 May 2022 06:58:22 GMT, David Holmes wrote: > Simply considering the compiler warning shouldn't `(arg+2) == NULL` actually > be `arg[2] == '\0'` ? as we are looking to see if this arg is only three > characters: '-', 'J' and '\0' Yeah, I thought that first, but I think better of keep

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-16 Thread David Holmes
On Fri, 13 May 2022 08:56:59 GMT, Yasumasa Suenaga wrote: > GCC 12 reports as following: I don't recall what "builtin arguments" means. Can you tell me how we would actually hit this conditions such that we string dup and the null string? Or are you saying this is actually an unreachable case

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-16 Thread David Holmes
On Fri, 13 May 2022 08:56:59 GMT, Yasumasa Suenaga wrote: > GCC 12 reports as following: src/java.base/share/native/libjli/java.c line 1632: > 1630: if (JLI_IsTraceLauncher()) { > 1631: printf("Empty option: jargv[%d]\n", i); > 1632: } I'd sa

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-16 Thread Yasumasa Suenaga
On Mon, 16 May 2022 13:20:49 GMT, David Holmes wrote: >> GCC 12 reports as following: > > I don't recall what "builtin arguments" means. Can you tell me how we would > actually hit this conditions such that we string dup and the null string? Or > are you saying this is actually an unreachable

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-16 Thread David Holmes
On Fri, 13 May 2022 08:56:59 GMT, Yasumasa Suenaga wrote: > GCC 12 reports as following: You forced me to look at this in depth. The values are set via the build system. In the build system it is impossible to get just -J because the -J is only added as a prefix for an existing string. So basi

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-17 Thread Yasumasa Suenaga
On Tue, 17 May 2022 04:39:06 GMT, David Holmes wrote: >> GCC 12 reports as following: > > You forced me to look at this in depth. The values are set via the build > system. In the build system it is impossible to get just -J because the -J is > only added as a prefix for an existing string. So

Re: RFR: 8286694: Incorrect argument processing in java launcher

2022-05-17 Thread David Holmes
On Tue, 17 May 2022 13:54:59 GMT, Yasumasa Suenaga wrote: >> You forced me to look at this in depth. The values are set via the build >> system. In the build system it is impossible to get just -J because the -J >> is only added as a prefix for an existing string. So basically this is >> impos

Re: RFR: 8286694: Incorrect argument processing in java launcher [v2]

2022-05-17 Thread Yasumasa Suenaga
> GCC 12 reports as following: Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - U

Re: RFR: 8286694: Incorrect argument processing in java launcher [v2]

2022-05-17 Thread David Holmes
On Tue, 17 May 2022 13:55:43 GMT, Yasumasa Suenaga wrote: >> GCC 12 reports as following: > > Yasumasa Suenaga has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull reque

Re: RFR: 8286694: Incorrect argument processing in java launcher [v2]

2022-05-18 Thread Thomas Stuefe
On Wed, 18 May 2022 06:12:41 GMT, David Holmes wrote: >> Yasumasa Suenaga has updated the pull request with a new target base due to >> a merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains three additional >> co

Re: RFR: 8286694: Incorrect argument processing in java launcher [v2]

2022-05-18 Thread David Holmes
On Wed, 18 May 2022 07:40:43 GMT, Thomas Stuefe wrote: >> src/java.base/share/native/libjli/java.c line 1631: >> >>> 1629: const char *arg = jargv[i]; >>> 1630: if (arg[0] == '-' && arg[1] == 'J') { >>> 1631: assert(arg[2] != '\0' && "Invalid JAVA_ARGS or >>> EXTRA_J