Subject: bug#58334: 29.0.50; ASAN heap use after free in gui_produce_glyphs

From: Eli Zaretskii <[email-masked]>
Date: Fri, 07 Oct 2022 15:14:55 +0300

> Date: Fri, 7 Oct 2022 14:08:02 +0200
> Cc: [email-masked], [email-masked]
> From: Gerd Möllmann <[email-masked]>
> 
> On 22-10-07 14:06 , Eli Zaretskii wrote:
> >> Date: Fri, 7 Oct 2022 14:03:58 +0200
> >> Cc: [email-masked], [email-masked]
> >> From: Gerd Möllmann <[email-masked]>
> >>
> >> On 22-10-07 14:01 , Eli Zaretskii wrote:
> >>> I don't see how "GC inhibited" is related, except by chance.  It
> >>> sounds wrong to conflate the two.
> >>
> >> Couldn't we bind it in nsterm.m?
> > 
> > Bind what?
> 
> int count = inhibit_garbahe_collection ();
> redisplay ();
> unbind_to...

Could be dangerous, unless we also inhibit all the hooks that
redisplay can call, because who knows what arbitrary Lisp can do to
memory?  And some of the Lisp called by redisplay can't be easily
disabled.  Example: the :eval forms in the mode line.