Fix assertion failure / crash in multi-core JIT (#53573)
authorKoundinya Veluri <kouvel@users.noreply.github.com>
Wed, 2 Jun 2021 14:28:59 +0000 (07:28 -0700)
committerGitHub <noreply@github.com>
Wed, 2 Jun 2021 14:28:59 +0000 (07:28 -0700)
commitf495f7ecfa8186e226bf21abcdfdb5682b25136b
treee8b49b76c5b4607a82e5116695f2a29d8f3c1c4f
parent1b8e971c1a4da7bd122510a6bfd59f8702cab344
Fix assertion failure / crash in multi-core JIT (#53573)

* Fix assertion failure / crash in multi-core JIT

- When the recorder times out it doesn't actually stop profiling, but writes out the profile
- The app may later stop profiling, and then it tries to write the profile again
- PR https://github.com/dotnet/runtime/pull/48326 fairly expected that the profile is only written once (some state is mutated)
- The non-timeout stop-profile path was also not stopping the timer
- Fix for https://github.com/dotnet/runtime/issues/53014 in main
src/coreclr/vm/multicorejit.cpp
src/coreclr/vm/multicorejitimpl.h
src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.cs [new file with mode: 0644]
src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.csproj [new file with mode: 0644]