Swallow exception in gc_heap::fire_etw_allocation_event (#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)
commitd5030420e022efde193ec53de4d9c98252f32fc9
treef80b8326097ef45e30a6529a735806b1696ede1f
parent03b0a5b5984f070d3a50770ebb8c1debdf07673a
Swallow exception in gc_heap::fire_etw_allocation_event (#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.
src/gc/gcee.cpp