Subject: Re: bug#17392: 24.3.90; cursor blinks faster and faster

From: Michael Heerdegen <[email-masked]>
Date: Sat, 10 May 2014 12:34:09 +0200

Hi,

In emacs -Q, I did

--8<---------------cut here---------------start------------->8---
(progn
  (advice-add 'timer-event-handler :before
              (lambda (timer)
                (unless (or (memq timer timer-list)
                            (memq timer timer-idle-list))
                  (message "This should not happen"))))
  (defun provoke (&rest _)
    (run-with-idle-timer .001 nil
                         (lambda () (sit-for 2.))))
  (defadvice handle-switch-frame (after provoke activate)
    (provoke)))
--8<---------------cut here---------------end--------------->8---

After switching frames a bit, I get "This should not happen".  So an
idle blinking timer not in timer-idle-list is called from C with
timer-event-handler.  At this point, there is already another blinking
timer in timer-idle-list.  timer-event-handler pushes the zombie timer
to timer-idle-list as well, so then we have two of them there etc.

Michael.