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

Stefan Karlsson stefank at openjdk.org
Wed May 29 11:10:04 UTC 2024


On Wed, 29 May 2024 09:16:13 GMT, Matthias Baesken <mbaesken 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() .

The difference is that the class metaspace is optional whereas the nonclass is not. I don't think that null-checks for the class space is a good argument that we should have them for the nonclass metaspace, which never should be null except in the extreme case when we crash before even having fully started the JVM.

I think I've made my point w.r.t. this, and I'll let Thomas decide if he still thinks that it is nicer to add these null-checks.

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

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


More information about the hotspot-runtime-dev mailing list