Subject: Re: bug#71243: 30.0.50; SIGSEGV: realize_face tries to uncache a null face

From: Daniel Clemente <[email-masked]>
Date: Tue, 28 May 2024 16:49:12 +0000

I can't reproduce this, and the fix looks fine, so I guess it can be
closed. Thanks.

On Tue, 28 May 2024 at 16:05, Eli Zaretskii <[email-masked]> wrote:

> > From: Daniel Clemente <[email-masked]>
> > Date: Tue, 28 May 2024 15:33:24 +0000
> >
> > This is similar to bug#71224. I was opening+killing frames in a loop
> with:
> >
> > for j in `seq 350`; do for i in `seq 10`; do urxvt -e emacsclient '-nw'
> '-e' '(dired "~")' &; done; sleep 2 && killall
> > emacsclient; done
> >
> > It's not too much stress, it's just opening 10 frames, waiting 2
> seconds, closing them, and repeating. It takes
> > time (and luck) until it reaches this SIGSEGV, it took around 5 minutes
> and several previous attempts where I
> > saw a different issue (bug#71223).
> > I can't reliably reproduce this.
> >
> > The emacs daemon was using this ~/.emacs. It's something I was using
> when reproducing bug#71176
> > (already fixed, though maybe some call to realize_face needs to be
> protected here to avoid this new case). I'm
> > not sure if the crash would happen with an empty emacs.
> >
> > (setq garbage-collection-messages t)
> > (set-face-foreground 'default "#bbb")
> >
> > Built without X support, running on X. My build is in a recent commit
> and with no patches added.
> >
> > Note that the stack is 12k functions high. Usually when this happens
> there will be a stack overflow (see
> > bug#71223) and Emacs reacts weirdly. I didn't see the stack overflow
> message this time, but the SIGSEGV
> > may be related to being at the stack limit.
> > In that case there may be nothing important to fix and this can be
> closed.
> >
> > process server <2814> no longer connected to pipe; closed it
> > process server <2815> no longer connected to pipe; closed it
> > process server <2822> no longer connected to pipe; closed it
> > process server <2823> no longer connected to pipe; closed it
> > process server <2824> no longer connected to pipe; closed it
> > process server <2825> no longer connected to pipe; closed it
> > process server <2832> no longer connected to pipe; closed it
> > process server <2833> no longer connected to pipe; closed it
> > process server <2834> no longer connected to pipe; closed it
> > process server <2835> no longer connected to pipe; closed it
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x00005555556664cc in uncache_face (c=0x555557a04a40, face=0x0) at
> xfaces.c:4929
> > 4929  int i = face->hash % FACE_CACHE_BUCKETS_SIZE;
> > (gdb) bt
> > #0  0x00005555556664cc in uncache_face (c=0x555557a04a40, face=0x0) at
> xfaces.c:4929
> > #1  0x0000555555668663 in realize_face (cache=0x555557a04a40,
> attrs=0x7fffffba6500,
> > former_face_id=13) at xfaces.c:6060
> > #2  0x0000555555668608 in realize_named_face (f=0x555557c5a558,
> symbol=XIL(0x117f0), id=13) at
> > xfaces.c:6037
>
> Thanks, I installed a fix.
>