RFR: 8281829: runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java fails after JDK-8281467 [v2]
Jie Fu
jiefu at openjdk.java.net
Wed Feb 16 08:14:39 UTC 2022
> Hi all,
>
> runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java fails due to SIGFPE after JDK-8281467 with release VMs.
> It can be reproduced by running `java -XX:+UnlockExperimentalVMOptions -XX:CodeEntryAlignment=4294967296` with release VMs.
>
> This is because `CodeEntryAlignment` would be converted from `intx` to `int` at line 825.
>
> 824 address generate_fp_mask(const char *stub_name, int64_t mask) {
> 825 __ align(CodeEntryAlignment);
> 826 StubCodeMark mark(this, "StubRoutines", stub_name);
> 827 address start = __ pc();
> 828
> 829 __ emit_data64( mask, relocInfo::none );
> 830 __ emit_data64( mask, relocInfo::none );
> 831
> 832 return start;
> 833 }
>
>
> Then at line 1187, `modulus` would become 0 after the conversion of `CodeEntryAlignment`, which leads to SIGFPE at line 1191.
>
> 1184 void MacroAssembler::align(int modulus) {
> 1185 // 8273459: Ensure alignment is possible with current segment alignment
> 1186 assert(modulus <= CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment");
> 1187 align(modulus, offset());
> 1188 }
> 1189
> 1190 void MacroAssembler::align(int modulus, int target) {
> 1191 if (target % modulus != 0) {
> 1192 nop(modulus - (target % modulus));
> 1193 }
> 1194 }
>
>
> The fix just adding a rule (`CodeEntryAlignment <= CodeCacheSegmentSize`) in `CodeEntryAlignmentConstraintFunc`.
>
> This is fine because we already has that rule in `CodeCacheSegmentSizeConstraintFunc`.
> And this is necessary since `CodeCacheSegmentSizeConstraintFunc` won't be called in release VMs.
>
> Thanks.
> Best regards,
> Jie
Jie Fu has updated the pull request incrementally with one additional commit since the last revision:
Address review comment
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/7480/files
- new: https://git.openjdk.java.net/jdk/pull/7480/files/b39bc8f3..5c274548
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7480&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7480&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/7480.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/7480/head:pull/7480
PR: https://git.openjdk.java.net/jdk/pull/7480
More information about the hotspot-compiler-dev
mailing list