Subject: bug#51577: 27.2; Regression: reproducible hang with face functions

From: Eli Zaretskii <[email-masked]>
Date: Fri, 05 Nov 2021 16:22:36 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Fri, 05 Nov 2021 14:24:17 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > It's only later, when the code does this:
> >
> >     (apply #'set-face-attribute 'region frame plist)))
> >
> > that it actually makes the 'region' face inherit from itself.
> 
> Well...   then we could do a check in `set-face-attribute' (too)?

That sets a single attribute, so you are proposing checking this for
each call?  The loop will only be evident near the end of the 'apply'
call.

> > Similarly, inheritance loops can (and usually do) appear at run time,
> > because faces are added or their attributes modified or merged with
> > other faces.
> 
> Hm...  will merging lead to loops?

That's exactly what happened in the case in point: we merged the
'default' font with the 'region' font.