Fix assert failure in grow_heap_segment for SVR GC. (#86889)
authorPeter Sollich <petersol@microsoft.com>
Tue, 30 May 2023 17:55:52 +0000 (19:55 +0200)
committerGitHub <noreply@github.com>
Tue, 30 May 2023 17:55:52 +0000 (10:55 -0700)
For my previous change, I overlooked the fact that we may call grow_heap_segment from within should_proceed_for_no_gc(), so it's too late to turn off gradual_decommit_in_progress_p after this method returns.

src/coreclr/gc/gc.cpp

index 5929320..5409d99 100644 (file)
@@ -6995,7 +6995,6 @@ void gc_heap::gc_thread_function ()
             {
                 update_collection_counts_for_no_gc();
                 proceed_with_gc_p = FALSE;
-                gradual_decommit_in_progress_p = FALSE;
             }
             else
             {
@@ -22935,6 +22934,11 @@ BOOL gc_heap::should_proceed_for_no_gc()
     BOOL no_gc_requested = FALSE;
     BOOL get_new_loh_segments = FALSE;
 
+#ifdef MULTIPLE_HEAPS
+    // need to turn off this flag here because of the call to grow_heap_segment below
+    gradual_decommit_in_progress_p = FALSE;
+#endif //MULTIPLE_HEAPS
+
     gc_heap* hp = nullptr;
     if (current_no_gc_region_info.soh_allocation_size)
     {