[crash] Crash Reporter V2 (#10532)
commitc3fe80a0c43be780e35f3a4091d3dc1023b35a00
authorAlexander Kyte <alexmkyte@gmail.com>
Thu, 11 Oct 2018 20:38:21 +0000 (11 16:38 -0400)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 11 Oct 2018 20:38:21 +0000 (11 16:38 -0400)
treee36699db22f0de76801769efa2f4cbbc84086bbe
parent92ebd1793bcd71681f9e07ade5e3a9afa0872cda
[crash] Crash Reporter V2 (#10532)

This change set represents a major set of changes to the crash reporting mechanism.

1) Coordination involving mandatory timeouts and signals have been changed greatly, to instead use semaphores and to end waiting as soon as possible.

2) Dumping of unmanaged symbols outside of mono has been made possible. Embedders that want to get information on frames outside of mono-sgen can register the library with an icall. This carefully preserves both privacy (opt-in) and resiliency (can't crash/lose more info when misused).

3) The dumper has moved from a workflow that kills the runtime after a long delay into one that can dump individual threads or the entire runtime in a prompt manner. The runtime doesn't die at the end of the dump, but allows threads to resume what they were doing and returns to the caller.

4) This has allowed for the addition of a number of tests that stress both parallel and concurrent dumping of threads. These run fairly quickly, and leave the runtime in a state to continue testing.

5) With this lightweight testing setup created, a long burn-in testing period was done. Places we were using locks or trying to malloc resulted in crashes or hangs. After making the needed changes, it managed to run the dumping tests in a loop for a whole weekend on a Linux x64 configuration without any problems.

This has resulted in a dumper with dramatically improved stability and performance.
27 files changed:
configure.ac
mcs/class/corlib/Mono/Runtime.cs
mcs/class/corlib/Test/System/ExceptionTest.cs
mono/metadata/class-internals.h
mono/metadata/debug-helpers.c
mono/metadata/domain-internals.h
mono/metadata/icall-decl.h
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/mono-debug.c
mono/metadata/object-internals.h
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/mini/aot-runtime.c
mono/mini/debugger-engine.c
mono/mini/interp/transform.c
mono/mini/mini-exceptions.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini-runtime.h
mono/mini/mini.c
mono/mini/seq-points.c
mono/mini/seq-points.h
mono/utils/mono-state.c
mono/utils/mono-state.h
mono/utils/mono-threads-posix.c
mono/utils/mono-threads.h