Fix gc stress coverage handling of epilogs on X86 (#40432)
authorDavid Wrighton <davidwr@microsoft.com>
Thu, 6 Aug 2020 23:48:52 +0000 (16:48 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Aug 2020 23:48:52 +0000 (16:48 -0700)
commit0e73b9ba818148078f07c8db21fe6e6b7df54251
treec799bc9b6544eda071389c14e4a5aa09deebed21
parentfe81abd171228e738bdea44aedb86acc9b32f239
Fix gc stress coverage handling of epilogs on X86 (#40432)

Epilog checking relies on precise control of when instrumentation for the  first prolog
instruction is enabled or disabled. In particular, if a function has multiple epilogs, or
the first execution of the function terminates via an exception, and subsequent completions
do not, then the function may trigger a false stress fault if epilog checks are not disabled.

This fix makes it so that if the first instruction is hit during a GC coverage in a situation where
the epilog could be examined in the future, that the epilog verification is disabled.

Also an opportunistic fix for a probably unimportant race condition around checking the
callerThread during epilog processing.
src/coreclr/src/vm/gccover.cpp