unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <akrl@sdf.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 58956@debbugs.gnu.org, Paul Eggert <eggert@cs.ucla.edu>,
	vincent@vinc17.net, 1017711@bugs.debian.org,
	spwhitton@spwhitton.name
Subject: bug#58956: mark_object, mark_objects(?) crash
Date: Fri, 04 Nov 2022 21:03:47 +0000	[thread overview]
Message-ID: <xjfwn8axwi4.fsf__34703.8612746232$1667596374$gmane$org@ma.sdf.org> (raw)
In-Reply-To: <83zgd75hll.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Nov 2022 09:00:54 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrea Corallo <akrl@sdf.org>
>> Cc: Vincent Lefevre <vincent@vinc17.net>, spwhitton@spwhitton.name,
>>         58956@debbugs.gnu.org, 1017711@bugs.debian.org
>> Date: Thu, 03 Nov 2022 21:25:08 +0000
>> 
>> AFAIU the Emacs subprocess we use to compile should behave like a
>> regular Emacs.
>
> Basically, you are saying that if the sub-process that runs
> async-compilation gets SIGHUP, it should abort and dump core, like a
> normal Emacs session does, right?
>
> The backtrace posted to the Debian bug tracker, here:
>
>   https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1017711;filename=gdb.txt;msg=5
>
> indicates that Emacs was in the middle of comp-copy-insn which was
> called from comp-fwprop.  Then Emacs performed GC, and SIGHUP was
> received during GC.  IOW, we were in our Lisp code, not in a libgccjit
> code, when the signal arrived.
>
> Another backtrace, posted here:
>
>   https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1017711;filename=gdb.txt;msg=45
>
> tells a somewhat different story: it doesn't show Emacs in the middle
> of a native compilation, but just inside substitute-command-keys that
> was called from command-line.

Sorry I missed those traces.  Okay so for both cases if libgccjit is not
involved the behaviour of Emacs here is just the plain one and should
not be related to native compilation.  It's just that native compilation
makes it more likely to be identify this condition.

>> Now, the only option that comes to my mind is that libgccjit (being
>> strictly derived from the GCC codebase) might be registering a signal
>> handler of some kind that alters the behaviour we expect.  But if this
>> is the case we should find trace of it the strace, or we can use gdb
>> setting a break point into 'signal' as well to check.
>> 
>> Indeed if this theory is true I think should be classified as a
>> libgccjit bug.
>
> I don't think it's true, see above.
>
> Paul, can you help here, please?  We need to establish what is the
> source of SIGHUP in these cases.  "These cases" mean, AFAIU, the
> situations where Emacs launched an async subprocess to do native
> compilation (which is another Emacs process in a --batch session), and
> the parent Emacs session is terminated by the user before the async
> compilation runs to completion.  Would the child Emacs process get
> SIGHUP in this scenario?  If yes, then I think we should treat SIGHUP
> differently in non-interactive invocations: instead of dumping core,
> we should catch the signal and exit with a non-zero exit status.
>
> Does this make sense?

To me yes.

> Andrea, if we do the above as I suggest, is there any cleanup that we
> need to do before exiting?  For example, what if the subprocess that
> does the async compilation already started writing the .eln file when
> the signal arrives?  What do we do today when the parent interactive
> Emacs is terminated by the user?

I think we have no special handling for this case, so yeah we might
leave some traces of the compilation.  Other than the .eln we should
also remove the lisp file we write to be loaded by the async compilation
process.  I'm not sure where and how would be best to handle all of this
tho.

Best Regards

  Andrea





  parent reply	other threads:[~2022-11-04 21:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  1:33 bug#58956: mark_object, mark_objects(?) crash Sean Whitton
2022-11-02 12:24 ` Eli Zaretskii
2022-11-03  3:00   ` Vincent Lefevre
2022-11-03  6:47     ` Eli Zaretskii
2022-11-03 10:13       ` Vincent Lefevre
2022-11-03 10:27         ` Eli Zaretskii
2022-11-03 21:25           ` Andrea Corallo
2022-11-04  7:00             ` Eli Zaretskii
     [not found]             ` <83zgd75hll.fsf@gnu.org>
2022-11-04 21:03               ` Andrea Corallo [this message]
2022-11-05 20:54               ` Paul Eggert
2022-11-06  5:51                 ` Eli Zaretskii
2022-11-06 19:18                   ` Paul Eggert
2022-11-06 19:32                     ` Eli Zaretskii
2022-11-06 19:44                       ` Paul Eggert
2022-11-06 19:58                         ` Eli Zaretskii
2022-11-08 19:44                 ` Sean Whitton
2022-11-10 10:14                 ` Eli Zaretskii
     [not found]                 ` <87cz9x1bav.fsf@melete.silentflame.com>
2022-11-10 10:23                   ` Vincent Lefevre
2022-11-11 18:32                     ` Sean Whitton
     [not found]                     ` <87cz9twddq.fsf@melete.silentflame.com>
2022-11-12  1:55                       ` Vincent Lefevre
2022-11-13 20:51                         ` Sean Whitton
     [not found] <20220819101031.GA1491685@zira.vinc17.org>
     [not found] ` <20220822005548.GA282574@zira.vinc17.org>
     [not found]   ` <87sfjr2cuf.fsf@melete.silentflame.com>
     [not found]     ` <20221014105322.GE12227@zira.vinc17.org>
     [not found]       ` <87ilk18mkw.fsf@melete.silentflame.com>
     [not found]         ` <20221031145917.GD8422@zira.vinc17.org>
     [not found]           ` <20221101221733.GB9018@zira.vinc17.org>
2022-11-02 21:43             ` bug#58956: Bug#1017711: emacs-gtk: terminated with signal SIGABRT, 137 MB coredump Sean Whitton

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='xjfwn8axwi4.fsf__34703.8612746232$1667596374$gmane$org@ma.sdf.org' \
    --to=akrl@sdf.org \
    --cc=1017711@bugs.debian.org \
    --cc=58956@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=spwhitton@spwhitton.name \
    --cc=vincent@vinc17.net \
    /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).