RFR: 8346916: [REDO] align_up has potential overflow

Casper Norrbin cnorrbin at openjdk.org
Mon Feb 24 15:20:55 UTC 2025


On Sun, 23 Feb 2025 09:59:51 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> > I don't see where we check the return value of align_up_or_min for the changes in src/hotspot/share/gc/shared/gcArguments.cpp. If tests fail because of align_up, maybe the test should be fixed?
> 
> I share @dean-long concerns. This PR doesn't seem like the right direction. I think the earlier PR was correct, and just uncovered problems elsewhere that should be fixed.

For `gcArguments.cpp`, we only check in debug builds with `DEBUG_ONLY(assert_flags();)`. I thought (wrongly) that we always checked. I'll look further into the tests related to that.

Besides that, I'm curious to hear what you feel is the "right direction". The other 3 cases here all account for the potential overflow. If it is possible to recover, I don't see the need to assert and crash. All other ~170 uses of `align_up` do crash, as they don't account for the overflow.

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

PR Comment: https://git.openjdk.org/jdk/pull/23711#issuecomment-2678775577


More information about the hotspot-dev mailing list