This fixes crashes that we see of the form # Problematic frame: # V [libjvm.so+0x7745a8] G1CollectedHeap::allocate_new_tlab(unsigned long, unsigned long, unsigned long*)+0xb8 The problem is that if the memory region isn't fully initialized, then further attempts to manipulate it, specifically top() in HeapRegion::par_allocate_impl(), will end up dereferencing NULL. --- a/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp Wed Oct 14 18:49:42 2020 +++ b/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp Wed Nov 6 08:09:08 2024 @@ -82,6 +82,12 @@ HeapRegion* alloc_region = _alloc_region; assert_alloc_region(alloc_region != NULL, "not initialized properly"); + // if we are null then we will SEGV later + // return NULL and let the caller retry or cleanup + if (alloc_region == NULL) { + return NULL; + } + HeapWord* result = par_allocate(alloc_region, min_word_size, desired_word_size, actual_word_size); if (result != NULL) { trace("alloc", min_word_size, desired_word_size, *actual_word_size, result);