[jdk21u] RFR: 8312573: Failure during CompileOnly parsing leads to ShouldNotReachHere [v2]
Tobias Holenstein
tholenstein at openjdk.org
Wed Aug 2 06:42:24 UTC 2023
On Wed, 2 Aug 2023 06:37:04 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> Parsing of `-XX:CompileOnly=` hits a `ShouldNotReachHere` for `,` and ` ` arguments. The fix is to remove the assumption that `className` can only be null for `method_sep` because the parsing loop also exits on `,` and ` `:
>>
>> https://github.com/openjdk/jdk21u/blob/384a8b85a7266b920242ea73baf578577ca588ec/src/hotspot/share/compiler/compilerOracle.cpp#L1032-L1037
>>
>> Instead, a missing class name is handled as "Any" class match in all the cases.
>>
>> I'm fixing this in JDK 21u because the issue was fixed in in JDK 22 as a side effect of [JDK-8027711](https://bugs.openjdk.org/browse/JDK-8027711). The VM now prints an error:
>>
>>
>> CompileOnly: An error occurred during parsing
>> Line: ','
>> Error: Could not create the Java Virtual Machine.
>> Error: A fatal exception has occurred. Program will exit.
>>
>>
>> Thanks,
>> Tobias
>
> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
>
> Change NULL to nullptr
Looks good to me
Marked as reviewed by tholenstein (no project role).
src/hotspot/share/compiler/compilerOracle.cpp line 1053:
> 1051: }
> 1052:
> 1053: if (className == NULL || className[0] == '\0') {
Suggestion:
if (className == nullptr || className[0] == '\0') {
-------------
PR Review: https://git.openjdk.org/jdk21u/pull/19#pullrequestreview-1558292398
PR Review: https://git.openjdk.org/jdk21u/pull/19#pullrequestreview-1558296098
PR Review Comment: https://git.openjdk.org/jdk21u/pull/19#discussion_r1281454065
More information about the jdk-updates-dev
mailing list