RFR: 8353468: [ubsan] arguments.cpp:2422:23: runtime error: 2.14748e+11 is outside the range of representable values of type 'int' [v4]
    David Holmes 
    dholmes at openjdk.org
       
    Mon Sep  1 04:46:49 UTC 2025
    
    
  
On Fri, 29 Aug 2025 13:46:28 GMT, Afshin Zafari <azafari at openjdk.org> wrote:
>> In converting values of `-XMinf` and `-XMaxf` options to `int`, overflow was not checked. 
>> The values are checked against INT_MAX and clamped.
>> 
>> Tests: tiers 1-5.
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
> 
>   improved tests and messages.
A further tweak to the error messages. Thanks
src/hotspot/share/runtime/arguments.cpp line 2429:
> 2427:         if (MinHeapFreeRatio > (uintx)(dmaxf * 100)) {
> 2428:           jio_fprintf(defaultStream::error_stream(),
> 2429:                       "-Xmaxf value (%s) which is also used for MaxHeapFreeRatio must be greater than or equal to MinHeapFreeRatio (%3.2lf)\n",
Suggestion:
                      "-Xmaxf value (%s) must be greater than or equal to the implicit -Xminf value (%3.2lf)\n",
src/hotspot/share/runtime/arguments.cpp line 2455:
> 2453:         if (MaxHeapFreeRatio < (uintx)(dminf * 100)) {
> 2454:           jio_fprintf(defaultStream::error_stream(),
> 2455:                       "-Xminf value (%s) which is also used for MinHeapFreeRatio must be less than or equal to MaxHeapFreeRatio (%3.2lf)\n",
Suggestion:
                      "-Xminf value (%s) must be less than or equal to the implicit -Xmaxf value (%3.2lf)\n",
-------------
PR Review: https://git.openjdk.org/jdk/pull/26859#pullrequestreview-3172075416
PR Review Comment: https://git.openjdk.org/jdk/pull/26859#discussion_r2312872055
PR Review Comment: https://git.openjdk.org/jdk/pull/26859#discussion_r2312872585
    
    
More information about the hotspot-runtime-dev
mailing list