[merp] Use a separate program as the hang supervisor. (mono/mono#15715)
authorAlexis Christoforides <alexis@thenull.net>
Fri, 9 Aug 2019 07:31:57 +0000 (10:31 +0300)
committerGitHub <noreply@github.com>
Fri, 9 Aug 2019 07:31:57 +0000 (10:31 +0300)
commitfbf69cf7e251ea08056750834ab86a7f757cdf53
treedd179ffce0baebfa65845a23efad00eea3bde86f
parent4f793f1d15c84d8be920d8bf695260575beeb9d8
[merp] Use a separate program as the hang supervisor. (mono/mono#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.

Commit migrated from https://github.com/mono/mono/commit/2c4b60fe24bfbccb3fa1553aed1065ce072343e1
src/mono/configure.ac
src/mono/mono/metadata/icall.c
src/mono/mono/metadata/threads-types.h
src/mono/mono/metadata/threads.c
src/mono/mono/utils/mono-state.c