From 1e70987cbb4a2debd139e07fb48c3fa6f6af6267 Mon Sep 17 00:00:00 2001 From: Bill Holmes Date: Fri, 12 Sep 2025 08:53:25 -0400 Subject: [PATCH] Protect calls to fork with a gc_lock on all MacOS variations Followup to https://github.com/Unity-Technologies/mono/pull/2124 We have reports of older version of MacOS showing the crash on fork even on M1 systems. Adding this thread protection appears to help those systems as well. --- mono/metadata/w32process-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mono/metadata/w32process-unix.c b/mono/metadata/w32process-unix.c index 5feb02eabf80..f5b5cf242091 100644 --- a/mono/metadata/w32process-unix.c +++ b/mono/metadata/w32process-unix.c @@ -1858,7 +1858,7 @@ process_create (const gunichar2 *appname, const gunichar2 *cmdline, mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_PROCESS, "%s: new process startup not synchronized. We may not notice if the newly created process exits immediately.", __func__); } -#if defined(HOST_DARWIN) && defined(TARGET_AMD64) +#if defined(HOST_DARWIN) mono_gc_invoke_with_gc_lock(fork_helper, &pid); #else pid = fork();