unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
@ 2022-09-09 14:40 Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-09-09 14:59 ` Robert Pluim
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-09 14:40 UTC (permalink / raw)
  To: 57699

[-- Attachment #1: Type: text/plain, Size: 902 bytes --]

Tags: patch

Tags: patch

Tags: patch

Recently on my Debian testing machines, my Emacs built with assertion
checks crash at startup with:

    process.c:8441: Emacs fatal error: assertion failed: lib_child_handler != dummy_handler

The patch below seems to fix it, but I have no idea if it's the right
thing to do.


        Stefan


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnux32, GTK+ Version 3.24.34, cairo version 1.16.0)
 of 2022-07-19 built on alfajor
Repository revision: 1c7aefa0c5327803f32aebbdf7cfed8d21f65f96
Repository branch: work
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules --with-cairo --with-tiff=ifavailable
 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign'
 PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: lib_child_handler.patch --]
[-- Type: text/patch, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-09 14:40 bug#57699: Assertion failure "lib_child_handler != dummy_handler" Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-09-09 14:59 ` Robert Pluim
  2022-09-09 15:27   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Robert Pluim @ 2022-09-09 14:59 UTC (permalink / raw)
  To: 57699; +Cc: Stefan Monnier

>>>>> On Fri, 09 Sep 2022 10:40:09 -0400, Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> said:

    Stefan> Tags: patch
    Stefan> Tags: patch

    Stefan> Tags: patch

    Stefan> Recently on my Debian testing machines, my Emacs built with assertion
    Stefan> checks crash at startup with:

    Stefan>     process.c:8441: Emacs fatal error: assertion failed: lib_child_handler != dummy_handler

    Stefan> The patch below seems to fix it, but I have no idea if it's the right
    Stefan> thing to do.

EEMPTYPATCH

Robert
-- 





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-09 14:59 ` Robert Pluim
@ 2022-09-09 15:27   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-09-09 17:13     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-09 15:27 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 57699

[-- Attachment #1: Type: text/plain, Size: 84 bytes --]

> EEMPTYPATCH

Hmm... not sure how that happened.
Let's try again.


        Stefan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: lib_child_handler.patch --]
[-- Type: text/x-diff, Size: 980 bytes --]

diff --git a/src/process.c b/src/process.c
index 7a133cda00f..331f7daf83e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -8438,11 +8438,15 @@ init_process_emacs (int sockfd)
       catch_child_signal ();
       g_source_unref (source);
 
-      eassert (lib_child_handler != dummy_handler);
-      signal_handler_t lib_child_handler_glib = lib_child_handler;
-      catch_child_signal ();
-      eassert (lib_child_handler == dummy_handler);
-      lib_child_handler = lib_child_handler_glib;
+      /* Apparently more recent versions of glib do not set this handler
+         any more, so make sure the dance is needed before going for it.  */
+      if (lib_child_handler != dummy_handler)
+        {
+          signal_handler_t lib_child_handler_glib = lib_child_handler;
+          catch_child_signal ();
+          eassert (lib_child_handler == dummy_handler);
+          lib_child_handler = lib_child_handler_glib;
+        }
 #else
       catch_child_signal ();
 #endif

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-09 15:27   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-09-09 17:13     ` Lars Ingebrigtsen
  2022-09-09 21:27       ` Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-09 17:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Robert Pluim, Paul Eggert, 57699

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> -      eassert (lib_child_handler != dummy_handler);
> -      signal_handler_t lib_child_handler_glib = lib_child_handler;
> -      catch_child_signal ();
> -      eassert (lib_child_handler == dummy_handler);
> -      lib_child_handler = lib_child_handler_glib;
> +      /* Apparently more recent versions of glib do not set this handler
> +         any more, so make sure the dance is needed before going for it.  */
> +      if (lib_child_handler != dummy_handler)
> +        {
> +          signal_handler_t lib_child_handler_glib = lib_child_handler;
> +          catch_child_signal ();
> +          eassert (lib_child_handler == dummy_handler);
> +          lib_child_handler = lib_child_handler_glib;

Perhaps Paul has some comments here; added to the CCs.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-09 17:13     ` Lars Ingebrigtsen
@ 2022-09-09 21:27       ` Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-09-11 11:38         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-09 21:27 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Stefan Monnier; +Cc: 57699-done, Robert Pluim

On 9/9/22 12:13, Lars Ingebrigtsen wrote:
> Perhaps Paul has some comments here; added to the CCs.

Stefan's patch looks good so I installed it (with my comments :-).

At some point Emacs should probably use the superior method of clone3 
with CLONE_PIDFD and waitid if available, so that it can avoid the 
hackery and races entailed by SIGCHLD.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-09 21:27       ` Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-09-11 11:38         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-09-11 11:47           ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-11 11:38 UTC (permalink / raw)
  To: 57699; +Cc: eggert, monnier

[-- Attachment #1: Type: text/plain, Size: 360 bytes --]

Paul Eggert via "Bug reports for GNU Emacs, the Swiss army knife of text editors" [2022-09-09 16:27 -0500] wrote:

> On 9/9/22 12:13, Lars Ingebrigtsen wrote:
>> Perhaps Paul has some comments here; added to the CCs.
>
> Stefan's patch looks good so I installed it (with my comments :-).

Thanks.

Building emacs-28 on Debian fails with the same fatal error:


[-- Attachment #2: Compilation log --]
[-- Type: application/gzip, Size: 11933 bytes --]

[-- Attachment #3: Type: text/plain, Size: 232 bytes --]


Can the fix be backported?

-- 
Basil

$ pkg-config --modversion glib-2.0
2.73.3
$ gcc --version
gcc (Debian 12.2.0-1) 12.2.0
$ uname -a
Linux tia 5.19.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.6-1
(2022-09-01) x86_64 GNU/Linux

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-11 11:38         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-09-11 11:47           ` Eli Zaretskii
  2022-09-11 13:54             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-09-11 11:47 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: eggert, monnier, 57699

> Cc: eggert@cs.ucla.edu, monnier@iro.umontreal.ca
> Date: Sun, 11 Sep 2022 14:38:29 +0300
> From:  "Basil L. Contovounesios" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> > Stefan's patch looks good so I installed it (with my comments :-).
> 
> Thanks.
> 
> Building emacs-28 on Debian fails with the same fatal error:
> 

Then use the same patch.

> Can the fix be backported?

It's too late for Emacs 28.2, I think, but we can look into
backporting it afterwards.  (I'm not very worried about 28.2, since
I'm sure the distros will pick up the change regardless.)






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-11 11:47           ` Eli Zaretskii
@ 2022-09-11 13:54             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-09-11 14:51               ` Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-11 13:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Basil L. Contovounesios, eggert, 57699

> It's too late for Emacs 28.2, I think, but we can look into
> backporting it afterwards.  (I'm not very worried about 28.2, since
> I'm sure the distros will pick up the change regardless.)

AFAIK they build without assertions, so maybe it'll will "just work"?


        Stefan






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57699: Assertion failure "lib_child_handler != dummy_handler"
  2022-09-11 13:54             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-09-11 14:51               ` Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 9+ messages in thread
From: Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-11 14:51 UTC (permalink / raw)
  To: Stefan Monnier, Eli Zaretskii; +Cc: Basil L. Contovounesios, 57699

On 9/11/22 08:54, Stefan Monnier wrote:
> AFAIK they build without assertions, so maybe it'll will "just work"?

Yes, that's my understanding.






^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-09-11 14:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-09 14:40 bug#57699: Assertion failure "lib_child_handler != dummy_handler" Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-09 14:59 ` Robert Pluim
2022-09-09 15:27   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-09 17:13     ` Lars Ingebrigtsen
2022-09-09 21:27       ` Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-11 11:38         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-11 11:47           ` Eli Zaretskii
2022-09-11 13:54             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-11 14:51               ` Paul Eggert via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).