Swallow exception in gc_heap::fire_etw_allocation_event (dotnet/coreclr#6571)
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 2 Aug 2016 20:35:06 +0000 (22:35 +0200)
committerGitHub <noreply@github.com>
Tue, 2 Aug 2016 20:35:06 +0000 (22:35 +0200)
commit424d1eae1f6cd16fe9534a8b48dfa08526d42066
tree710e31fcbe4d312e4861b453e223d016ba41e580
parentef766330bf56f86413ef3cb269f34963e990a0ac
Swallow exception in gc_heap::fire_etw_allocation_event (dotnet/coreclr#6571)

The gc_heap::fire_etw_allocation_event calls TypeHandle::GetName that can throw
due to OOM. But we don't want failures to fire event cause a failure during the GC,
so such exception should be swallowed and no event fired in such case.
This was discovered as a contract failure during test runs with ETW logging enabled
when this function was transitively called from Thread::PerformPreemptiveGC which
was recently modified to have NOTHROW contract.
Interestingly, this was not detected by the static contract checker.

Commit migrated from https://github.com/dotnet/coreclr/commit/d5030420e022efde193ec53de4d9c98252f32fc9
src/coreclr/src/gc/gcee.cpp