RFR: 8283641: Large value for CompileThresholdScaling causes assert
Vladimir Kozlov
kvn at openjdk.java.net
Thu Mar 24 17:45:43 UTC 2022
On Thu, 24 Mar 2022 16:34:07 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> Please review this trivial fix that checks for overflow of `(intx)(threshold * scale)`
>
> Before:
>
> $ java -XX:CompileThresholdScaling=12345678901234567890.0 -version
> ...
> # Internal Error (/jdk/open/src/hotspot/share/utilities/powerOfTwo.hpp:54), pid=4147940, tid=4147941
> # assert(value > T(0)) failed: value must be > 0
>
>
> After:
>
>
> $ java -XX:CompileThresholdScaling=12345678901234567890.0 -version
> intx Tier0InvokeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
> ...
> OnStackReplacePercentage cannot be validated because CompileThreshold value is invalid
> CompileThreshold (9223372036854775807) must be between 0 and 1073741823
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit.
>
>
> Tested with tiers 1-2.
src/hotspot/share/compiler/compilerDefinitions.cpp line 133:
> 131: if (v > max_intx) {
> 132: return max_intx;
> 133: } else if (v < min_intx) {
This check is meaningless since `v` can't be negative. If you want you can add assert.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7944
More information about the hotspot-compiler-dev
mailing list