RFR: 8365606: Container code should not be using jlong/julong
Andrew Haley
aph at openjdk.org
Wed Sep 10 07:57:57 UTC 2025
On Tue, 9 Sep 2025 09:49:00 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> > On some 32-bit systems this PR moves memory sizes from 64 bits, where they can't overflow, to 32 bits, where they can. While I've looked at this carefully, I can't exclude the possibility that overflow may occur.
> > While we could pick through every change line by line, wouldn't it be safer simply to stay with 64-bit sizes on all systems?
>
> I agree. It's a valid concern. But this PR is basically an extension to [JDK-8357086](https://bugs.openjdk.org/browse/JDK-8357086). That one is already in JDK 26.
`size_t` isn't a problem because it can't overflow, but `ssize_t` is a problem. Integer overflow is undefined behaviour .
>It's also worth noting that 32-bit support is [on its way out](https://mail.openjdk.org/pipermail/jdk-dev/2025-April/009909.html).
Sure, but that's no reason to introduce risky code to 32-bit systems.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27125#issuecomment-3273771257
More information about the hotspot-dev
mailing list