RFR: 8281829: runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java fails after JDK-8281467

Tobias Hartmann thartmann at openjdk.java.net
Wed Feb 16 07:55:05 UTC 2022


On Tue, 15 Feb 2022 14:51:29 GMT, Jie Fu <jiefu at openjdk.org> wrote:

> 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

Looks good to me otherwise.

src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp line 233:

> 231:   if ((uintx)CodeEntryAlignment > CodeCacheSegmentSize) {
> 232:     JVMFlag::printError(verbose,
> 233:                         "CodeEntryAlignment  (" INTX_FORMAT ") must be "

Suggestion:

                        "CodeEntryAlignment (" INTX_FORMAT ") must be "

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

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7480


More information about the hotspot-runtime-dev mailing list