all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Gijs Hillenius" <gijs@hillenius.net>
Cc: 39824@debbugs.gnu.org
Subject: bug#39824: 26.2; timers sometimes stop working when coming back from sleep
Date: Wed, 25 Mar 2020 16:37:10 +0200	[thread overview]
Message-ID: <83tv2ca4bt.fsf@gnu.org> (raw)
In-Reply-To: <874kueb1jj.fsf@hillenius.net> (message from Gijs Hillenius on Tue, 24 Mar 2020 09:27:28 +0100)

> From: Gijs Hillenius <gijs@hillenius.net>
> Date: Tue, 24 Mar 2020 09:27:28 +0100
> 
> Since Sunday, I've been running emacs¹ from GDB, but there is nothing
> much to report. At startup, init.el sets  (run-at-time "10:35" 21600
> 'org-mobile-push). It ran on Sunday, but not on Monday (yesterday) -
> despite a good night's sleep.
> 
> Today (Tuesday), M-x timer-list shows:
> 
>       -59170.00   360.00 org-mobile-push
> 
> and from describe-variable timer-list :
> 
> ([t 24184 55076 0 21600 org-mobile-push nil nil 0]

The time of this timer is 23-Mar-2020 16:35 +0100.  This probably
means the timer did run at 10:35 that day, but you seem to say it
didn't.  Are you sure?  If it didn't run, we might have 2 mysteries
here instead of just one (the second one being how come the timer
didn't run, but the time it should run was updated).

Anyway, the real problem is that t in the first element of the vector.
It means the timer will never be run, because t means "running now",
something that should only be seen by code that is directly or
indirectly called by the timer function itself.  So it should never be
seen when you examine timer-list via M-: etc.

When Emacs finds a timer which is "ripe", i.e. its time has passed, it
updates its next time, then marks it with that t, then calls the timer
function, then replaces t with nil if the timer is to be repeated (as
it is in this case).  So the main question to be answered is: how come
that t remained in the timer?  I looked at timer-event-handler, the
function we call to run the timer, and didn't see there any way we
could fail to update the timer with nil after its function returns,
but I'm probably missing something because it factually did happen.

Can you instrument timer-event-handler, such that it will record in
some buffer everything that happens with the timer that calls
org-mobile-push?  In particular, is it possible that you put the
machine to sleep while the timer is running?  If so, what happens then
(I don't know how your system deals with sleep, and what do running
programs do during the sleep time)?  With such instrumentation in
place, when this problem happens next, we might get some idea
regarding what causes this strange situation.

Thanks.





  reply	other threads:[~2020-03-25 14:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 15:52 bug#39824: 26.2; timers sometimes stop working when coming back from sleep ndame
2020-03-01 19:31 ` Eli Zaretskii
2020-03-02  5:22   ` ndame
2020-03-02  5:29     ` ndame
2020-03-06  9:14     ` Eli Zaretskii
2020-03-06 16:30       ` ndame
2020-03-06 17:07         ` Eli Zaretskii
2020-03-21  9:23           ` Gijs Hillenius
2020-03-24  8:27       ` Gijs Hillenius
2020-03-25 14:37         ` Eli Zaretskii [this message]
2020-03-25 14:55           ` Gijs Hillenius
2020-04-01  7:09           ` Gijs Hillenius
2020-04-03 12:35             ` Eli Zaretskii
2020-04-08 14:54           ` bug#39824: I can't reproduce this any longer (was: bug#39824: 26.2; timers sometimes stop working when coming back from sleep) Gijs Hillenius
2020-04-08 15:11             ` Eli Zaretskii
2020-04-19 13:28 ` bug#39824: 26.2; timers sometimes stop working when coming back from sleep ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 13:59 ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 15:28   ` Eli Zaretskii
2020-04-19 15:54     ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 16:46       ` Eli Zaretskii
2020-04-19 17:34         ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 18:53           ` Eli Zaretskii
     [not found]             ` <CADwFkm=i7zz8xjw=RcbFg7evQqBFpMY5phHEJnfQk+n75Y2LRg@mail.gmail.com>
2020-08-23 12:58               ` Eli Zaretskii
2020-08-23 13:36                 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83tv2ca4bt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=39824@debbugs.gnu.org \
    --cc=gijs@hillenius.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.