Fix profiler crash on shutdown (dotnet/coreclr#22712)
authorNoah Falk <noahfalk@users.noreply.github.com>
Wed, 22 May 2019 04:52:18 +0000 (21:52 -0700)
committerDavid Mason <davmason@microsoft.com>
Wed, 22 May 2019 04:52:18 +0000 (21:52 -0700)
commitba776b52b446b9fb12979ed22699e267442f77a4
treeb343af2e37fd037874c3b5f903541e15ec221ddd
parent45ae75bfad49ae945fce28ba8eacf4f6073534fd
Fix profiler crash on shutdown (dotnet/coreclr#22712)

Fixes issue dotnet/coreclr#22176. Use the profiler evacuation counters to ensure that we
don't callback into the profiler when it has already been released.
Previously we only did this as part of the attach/detach feature, but this
is required for correctness during standard shutdown given that managed
threads are still running concurrently.

Commit migrated from https://github.com/dotnet/coreclr/commit/671772c20a27c050df3d7d11391ea4f7de05165c
src/coreclr/src/vm/ceemain.cpp
src/coreclr/src/vm/eetoprofinterfaceimpl.cpp
src/coreclr/src/vm/profdetach.cpp
src/coreclr/src/vm/profdetach.h
src/coreclr/src/vm/profilinghelper.cpp
src/coreclr/src/vm/profilinghelper.h
src/coreclr/src/vm/threads.cpp
src/coreclr/src/vm/threads.h