RFR: 8332955: ubsan: runningCounters.cpp:48:61: runtime error: member call on null pointer of type 'struct VirtualSpaceList'

Matthias Baesken mbaesken at openjdk.org
Wed May 29 09:19:04 UTC 2024


On Wed, 29 May 2024 07:50:46 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> It seems unfortunate to have to pollute the code with these checks just because we crash during startup. Could this instead be fixed by not calling into `MemTracker::error_report` if we crash too early?

We had those nullptr checks anyway in the getters using VirtualSpaceList::vslist_class(); so it is probably safer to do the same for VirtualSpaceList::vslist_nonclass() .
Even if the callers are adjusted and the ubsan detected issue is gone for the moment, it can always happen that the calling code is reorganized a bit in future and we member-function-call again into a nullptr.

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

PR Comment: https://git.openjdk.org/jdk/pull/19435#issuecomment-2136937425


More information about the hotspot-runtime-dev mailing list