From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#46494: 28.0.50; [native-comp] Problems with async background compile Date: Sun, 21 Feb 2021 21:22:16 +0000 Message-ID: References: <52dad420-fd72-fe1c-6f74-f4c114a2deb8@gmail.com> <83sg5ybr95.fsf@gnu.org> <834ki710ug.fsf@gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5773"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: andrewjmoreton@gmail.com, 46494@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 21 22:23:09 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 1lDwC5-0001O0-7L for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Feb 2021 22:23:09 +0100 Original-Received: from localhost ([::1]:40468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDwC4-0006lO-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Feb 2021 16:23:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDwBy-0006lG-72 for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2021 16:23:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43527) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDwBx-0000yK-W2 for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2021 16:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDwBx-0002s7-S6 for bug-gnu-emacs@gnu.org; Sun, 21 Feb 2021 16:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Feb 2021 21:23: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.161394254210980 (code B ref 46494); Sun, 21 Feb 2021 21:23:01 +0000 Original-Received: (at 46494) by debbugs.gnu.org; 21 Feb 2021 21:22:22 +0000 Original-Received: from localhost ([127.0.0.1]:55073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDwBJ-0002r2-O4 for submit@debbugs.gnu.org; Sun, 21 Feb 2021 16:22:22 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:64129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDwBF-0002qr-QZ for 46494@debbugs.gnu.org; Sun, 21 Feb 2021 16:22:20 -0500 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 11LLMGrH009120 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sun, 21 Feb 2021 21:22:17 GMT In-Reply-To: <834ki710ug.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Feb 2021 12:37:43 +0200") 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:200529 Archived-At: Eli Zaretskii writes: >> 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? No precise idea about sorry. Perhaps the best place to ask and discuss that would be jit@gcc.gnu.org? > . 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? Yes it does, should we change this? > 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". da4da88c76 fix one case of this. We use `paths' in `native-compile-async' and `native--compile-async' as arg name. This can be either a file, a list of file or a list of directories. What would be the suggested name for something like that? Thanks Andrea