bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46494: 28.0.50; [native-comp] Problems with async background compile


From: Andrea Corallo
Subject: bug#46494: 28.0.50; [native-comp] Problems with async background compile
Date: Sun, 21 Feb 2021 21:22:16 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]