From 86574e488a98f066d5f56b8acfe4b5abd953c498 Mon Sep 17 00:00:00 2001 From: Sean Gillespie Date: Fri, 30 Jun 2017 13:29:48 -0700 Subject: [PATCH] Fix an issue where g_ephemeral_low would never get bashed into the write (dotnet/coreclr#12563) barrier when starting up with Server GC (x86 only). Commit migrated from https://github.com/dotnet/coreclr/commit/7a283118b871458fd46d4593f2e6e3126701e4bc --- src/coreclr/src/vm/gcenv.ee.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/gcenv.ee.cpp b/src/coreclr/src/vm/gcenv.ee.cpp index 55b1a96..6fe9a71 100644 --- a/src/coreclr/src/vm/gcenv.ee.cpp +++ b/src/coreclr/src/vm/gcenv.ee.cpp @@ -923,10 +923,13 @@ void GCToEEInterface::StompWriteBarrier(WriteBarrierParameters* args) VolatileStore(&g_highest_address, args->highest_address); ::StompWriteBarrierResize(true, false); - // g_ephemeral_low/high aren't needed for the write barrier stomp, but they - // are needed in other places. + // StompWriteBarrierResize does not necessarily bash g_ephemeral_low + // usages, so we must do so here. This is particularly true on x86, + // where StompWriteBarrierResize will not bash g_ephemeral_low when + // called with the parameters (true, false), as it is above. g_ephemeral_low = args->ephemeral_low; g_ephemeral_high = args->ephemeral_high; + ::StompWriteBarrierEphemeral(true); return; case WriteBarrierOp::SwitchToWriteWatch: #ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP -- 2.7.4