[merp] Use a separate program as the hang supervisor. (#15715)
commit2c4b60fe24bfbccb3fa1553aed1065ce072343e1
authorAlexis Christoforides <alexis@thenull.net>
Fri, 9 Aug 2019 07:31:57 +0000 (9 10:31 +0300)
committerGitHub <noreply@github.com>
Fri, 9 Aug 2019 07:31:57 +0000 (9 10:31 +0300)
tree4bb49c6a8dc60edb3cb2ee8ac1b01ca774e2df7f
parent6a459c25d771dec436bb6a8785c683f6b15fe6f7
[merp] Use a separate program as the hang supervisor. (#15715)

* [merp] Use a separate program as the hang supervisor.

Fixes https://github.com/mono/mono/issues/15646

macOS does not like signals being sent from the forked supervisor process, possibly towards anywhere but definitely when sent to the parent process. The following message is currently spewed after the supervisor process attempting to send a SIGSEGV to a hanged Mono process:
"The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec()."

We follow that direction and introduce a new binary that, when available in the mono executable's binary directory, is used to abort the parent process for us.
configure.ac
mono/metadata/icall.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/utils/mono-state.c
runtime/bin/mono-hang-watchdog.in [new file with mode: 0644]
tools/Makefile.am
tools/mono-hang-watchdog/Makefile.am [new file with mode: 0644]
tools/mono-hang-watchdog/mono-hang-watchdog.c [new file with mode: 0644]