From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46494: 28.0.50; [native-comp] Problems with async background compile Date: Sat, 20 Feb 2021 12:37:43 +0200 Message-ID: <834ki710ug.fsf@gnu.org> References: <52dad420-fd72-fe1c-6f74-f4c114a2deb8@gmail.com> <83sg5ybr95.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15358"; mail-complaints-to="usenet@ciao.gmane.io" Cc: andrewjmoreton@gmail.com, 46494@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 20 11:39:08 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDPfI-0003u9-Mg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 11:39:08 +0100 Original-Received: from localhost ([::1]:53930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDPfH-0002su-Jt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 05:39:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDPfC-0002so-5x for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 05:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDPfB-00022i-VY for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 05:39:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDPfB-0000bN-Sh for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 05:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Feb 2021 10:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46494 X-GNU-PR-Package: emacs Original-Received: via spool by 46494-submit@debbugs.gnu.org id=B46494.16138174922248 (code B ref 46494); Sat, 20 Feb 2021 10:39:01 +0000 Original-Received: (at 46494) by debbugs.gnu.org; 20 Feb 2021 10:38:12 +0000 Original-Received: from localhost ([127.0.0.1]:51059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDPeO-0000aB-Cl for submit@debbugs.gnu.org; Sat, 20 Feb 2021 05:38:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDPeL-0000Zv-Kr for 46494@debbugs.gnu.org; Sat, 20 Feb 2021 05:38:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41553) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDPeF-0001br-3x; Sat, 20 Feb 2021 05:38:03 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4006 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lDPeE-0000gM-CX; Sat, 20 Feb 2021 05:38:02 -0500 In-Reply-To: (message from Andrea Corallo on Sun, 14 Feb 2021 18:28:02 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200412 Archived-At: > From: Andrea Corallo > Cc: andrewjmoreton@gmail.com, 46494@debbugs.gnu.org > Date: Sun, 14 Feb 2021 18:28:02 +0000 > > >> > c) Quitting emacs when async compilation processes are running sometimes > >> > causes crashes in the compile processes, which show the emacs abort > >> > dialog (once for each async process). The dialogs disappear after a > >> > short delay (presumably due to the parent emacs having exited). > >> > >> Mmmh, I guess this is a Windows specific behavior. Is there a specific > >> way to shut-down child processes we would use on Windows not to get > >> this error? > > > > Andrea, can you point me to the place where we interrupt async > > compilations when Emacs exits? Is that just a normal delete-process, > > or do we do something else, like sending a signal? Also, does the > > Emacs subprocess invoked to perform async compilation spawn further > > child processes, or is everything happening inside a single Emacs > > process? > > Hi Eli, > > we have no special handling for closing async compilation processes, > they should be closed as all child processes started by Emacs are. > > In the child process we do not spawn directly any other process, but > libgccjit might do it (ex to call gas). OK, I've reviewed the code which kills subprocesses when Emacs is shut down, and I have some questions: . How does libgccjit handle the case that its process is exiting? Does it have any atexit handlers or static destructors? IOW, how does it ensure its own subprocesses, like gas etc. are terminated? . When we invoke Emacs in a subprocess to do the async compilation, do we specify that it should be killed without query? I don't see this in the code (did I miss it?), but if we don't, then exiting Emacs will ask the user whether to kill the subprocesses -- does it? Andy, if instead if exiting Emacs, you use signal-process, like this: M-: (signal-process PROC-ID 'SIGHUP) RET (where PROC-ID is the process ID of the Emacs subprocess running the native compilation), do you see the same crash, or does the subprocess exit cleanly? To see the PROC-ID, you can use the Task manager or the 'pslist' command from the PsTools suite. Thanks. P.S. Andrea, I see you use "path" in comp.el (and perhaps elsewhere) to mean "file name", but the GNU Coding Standards frown on using this for anything other than PATH-style directory lists. So this should at some point be replaced with "file name".