RFR: 8333639: ubsan: cppVtables.cpp:81:55: runtime error: index 14 out of bounds for type 'long int [1]' [v2]

Martin Doerr mdoerr at openjdk.org
Tue Jun 11 09:00:21 UTC 2024


On Mon, 10 Jun 2024 13:34:22 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> We shouldn't specify a wrong array length which causes undefined behavior. Using a "flexible array member".
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Flexible array members are not specified by C++.

The implementation in `BufferNode` looks like the pattern which I'm fixing, here. The length is specified, but we're accessing the array beyond it and this is what UBSan is complaining about. The idea here is to avoid specifying the length and using a plain address computation instead. UBSan seems to be happy with it. Do you still see UB involved, here?

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

PR Comment: https://git.openjdk.org/jdk/pull/19623#issuecomment-2160168614


More information about the hotspot-runtime-dev mailing list