unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: andrewjmoreton@gmail.com, 46494@debbugs.gnu.org
Subject: bug#46494: 28.0.50; [native-comp] Problems with async background compile
Date: Sun, 21 Feb 2021 21:22:16 +0000	[thread overview]
Message-ID: <xjfo8gdktfb.fsf@sdf.org> (raw)
In-Reply-To: <834ki710ug.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Feb 2021 12:37:43 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrea Corallo <akrl@sdf.org>
>> 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





  parent reply	other threads:[~2021-02-21 21:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-13 16:58 bug#46494: 28.0.50; [native-comp] Problems with async background compile Andy Moreton
2021-02-13 18:12 ` Eli Zaretskii
2021-02-13 20:20   ` Andy Moreton
2021-02-13 20:24     ` Eli Zaretskii
2021-02-14  8:01 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-14 15:31   ` Eli Zaretskii
2021-02-14 18:28     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-14 19:11       ` Eli Zaretskii
2021-02-20 10:37       ` Eli Zaretskii
2021-02-20 12:09         ` Andy Moreton
2021-02-20 12:54           ` Eli Zaretskii
2021-02-20 16:40             ` Andy Moreton
2021-02-20 16:54               ` Eli Zaretskii
2021-02-20 17:30                 ` Andy Moreton
2021-02-20 17:37                   ` Eli Zaretskii
2021-03-07 14:34               ` Eli Zaretskii
2021-03-08  0:19                 ` Andy Moreton
2021-03-08  3:27                   ` Eli Zaretskii
2021-02-21 21:22         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-02-22  3:28           ` Eli Zaretskii
2021-02-22 19:51             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-16 16:53 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-16 18:34   ` Eli Zaretskii
2021-03-16 20:10     ` Andy Moreton
2021-03-16 20:48       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjfo8gdktfb.fsf@sdf.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=46494@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=andrewjmoreton@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).