# HG changeset patch # User Kyle Lippincott # Date 2020-02-20 23:15:23 # Node ID 6392bd7c26a88fffdb5dcecdae53a49fcd494ed3 # Parent 9dab3fa643257ce3094a628f937322235ab3faba darwin: add another preemptive gui() call when using chg Changeset a89381e04c58 added this gui() call before background forks, and Google's extensions do background forks on essentially every invocation for logging purposes. The crash is reliably (though not 100%) reproducible without this change when running `HGPLAIN=1 chg status` in one of our repos. With this fix, I haven't been able to trigger the crash anymore. Differential Revision: https://phab.mercurial-scm.org/D8141 diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py --- a/mercurial/commandserver.py +++ b/mercurial/commandserver.py @@ -545,6 +545,10 @@ class unixforkingservice(object): if maxlen < 0: raise error.Abort(_(b'negative max-repo-cache size not allowed')) self._repoloader = repocache.repoloader(ui, maxlen) + # attempt to avoid crash in CoreFoundation when using chg after fix in + # a89381e04c58 + if pycompat.isdarwin: + procutil.gui() def init(self): self._sock = socket.socket(socket.AF_UNIX)