Subject: bug#21380: 25.0.50; GTK-induced segfault when scheduling timer from window-configuration-change-hook

From: Eli Zaretskii <[email-masked]>
Date: Wed, 02 Sep 2015 18:08:00 +0300

> Date: Tue, 1 Sep 2015 20:48:18 +0000
> From: Pip Cet <[email-masked]>
> Cc: [email-masked]
> 
>     Alternatively, we could turn off atimers (by calling turn_on_atimers)
>     while Fcopy_sequence runs.
>     
> 
> I think that would be a better solution. I've done a quick grep for the current
> atimers and at first glance they appear to be okay, but obviously that's no
> guarantee for the future. It might be worth thinking about
> block_input_and_atimers ().
> 
> I think it's safe to assume that Lisp timers are only checked if atimers are
> enabled.

Those are two completely separate and independent features, so no,
it's not safe to make that assumption.  Not sure why you need to
assume that, though.

> If it isn't, I think the best way forward is to write
> block_input_and_atimers () and lock atimers with a counter just like input is.

Not sure I follow you.  Are you saying that just calling block_input
followed by turn_on_atimers is somehow not enough to prevent some Lisp
from changing Vtimer_list under our feet?

> --- a/src/fns.c
> +++ b/src/fns.c
> @@ -744,6 +744,9 @@ concat (ptrdiff_t nargs, Lisp_Object *args,
>  	    /* Store this element into the result.  */
>  	    if (toindex < 0)
>  	      {
> +                if (NILP (tail))
> +                  break;
> +

Is this part still needed?  If so, can you explain in what situation
it is needed?

Thanks.