Subject: bug#74224: [PATCH][scratch/igc] pgtk: fix crashing bug in atimer used for checking scaling

From: Jeff Walsh <[email-masked]>
Date: Wed, 6 Nov 2024 21:44:57 +1100

> LGTM. Can you commit that yourself to the branch?

I don't have a savannah account for emacs, but I have just registered and
will chase up approvals.

timers are cleaned up by cancel_atimer(), then they get put on a free list
(`free_atimers` on line 132 in the snippet).
It appears that we rely on the OS to cleanup at emacs shutdown.

On Wed, Nov 6, 2024 at 9:36 PM Gerd Möllmann <[email-masked]>
wrote:

> Jeff Walsh <[email-masked]> writes:
>
> >  #ifdef WINDOWSNT
> >  #define raise(s) w32_raise(s)
> > @@ -132,7 +133,13 @@ start_atimer (enum atimer_type type, struct
> timespec timestamp,
> >        free_atimers = t->next;
> >      }
> >    else
> > -    t = xmalloc (sizeof *t);
> > +    {
> > +#ifdef HAVE_MPS
> > +      t = igc_xzalloc_ambig (sizeof *t);
> > +#else
> > +      t = xmalloc (sizeof *t);
> > +#endif
> > +    }
> >
> >    /* Fill the atimer structure.  */
> >    memset (t, 0, sizeof *t);
>
> On second thought, and I don't know if it's relevant, do we need to
> igc_xfree that?
>