all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15561: Fwd: bug#15561: periodic timer stops running
       [not found] <CAFM41H34WhVZ_fCWoh9BxDqs07OPXi_u=5ghTHkv_zAp22SxBA@mail.gmail.com>
@ 2014-02-27 22:11 ` Barry OReilly
       [not found] ` <530FF70C.2020905@cs.ucla.edu>
  1 sibling, 0 replies; 5+ messages in thread
From: Barry OReilly @ 2014-02-27 22:11 UTC (permalink / raw
  To: 15561

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

The patch addresses:

> If it means to block SIGALRM during timers, that doesn't always
> happen because timers run within timers. The end of an inner timer
> would unblock SIGALRM and the outer timer would finish with the
> sigmask unblocked.

but I don't see it address:

> But what happens if the next timer happens to be soon, and Emacs
> receives SIGALRM inbetween set_alarm and unblock_timers?

That one sounds more likely to cause a timer to stop.

[-- Attachment #2: Type: text/html, Size: 613 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#15561: periodic timer stops running
       [not found] ` <530FF70C.2020905@cs.ucla.edu>
@ 2014-02-28  2:42   ` Paul Eggert
  2014-02-28  8:03     ` bug#15561: " Dmitry Antipov
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2014-02-28  2:42 UTC (permalink / raw
  To: Barry OReilly; +Cc: 15561

[Resending with corrected bug-report address; sorry about that.]

Barry OReilly wrote:
> But what happens if the next timer happens to be soon, and Emacs receives SIGALRM inbetween set_alarm and unblock_timers?

Are you talking about a SIGALRM received during the execution of 
do_pending_atimers, between run_timer's call to set_alarm and 
do_pending_atimers's call to unblock_atimers?  If so, the SIGALRM should 
be held by the operating system during that period, and Emacs won't be 
informed of the SIGALRM until unblock_atimers does its thing.  Sorry, I 
don't see how this would cause a timer to stop.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#15561: Re: bug#15561: periodic timer stops running
  2014-02-28  2:42   ` Paul Eggert
@ 2014-02-28  8:03     ` Dmitry Antipov
  2014-02-28  9:18       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Antipov @ 2014-02-28  8:03 UTC (permalink / raw
  To: Paul Eggert; +Cc: 15561

On 02/28/2014 06:42 AM, Paul Eggert wrote:

> [Resending with corrected bug-report address; sorry about that.]
>
> Barry OReilly wrote:
>> But what happens if the next timer happens to be soon, and Emacs receives SIGALRM inbetween set_alarm and unblock_timers?
>
> Are you talking about a SIGALRM received during the execution of do_pending_atimers, between run_timer's call to set_alarm and do_pending_atimers's call to unblock_atimers?  If so, the SIGALRM should
> be held by the operating system during that period, and Emacs won't be informed of the SIGALRM until unblock_atimers does its thing.  Sorry, I don't see how this would cause a timer to stop.

BTW, we have at least one backtrace with nested calls to timer_check_2 (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16817#11):

...
64  Emacs                               0x00000001002067b2 Ffuncall + 1762 (eval.c:2827)
65  Emacs                               0x00000001002070e9 call1 + 73 (eval.c:2572)
66  Emacs                               0x000000010013d6a6 timer_check_2 + 1846 (keyboard.c:4447)                   ;; Nested call
67  Emacs                               0x000000010013cef5 timer_check + 165 (keyboard.c:4514)
68  Emacs                               0x0000000100139c25 readable_events + 37 (keyboard.c:3405)
69  Emacs                               0x000000010013cdb6 get_input_pending + 54 (keyboard.c:6794)
70  Emacs                               0x0000000100142ce4 Finput_pending_p + 132 (keyboard.c:10449)
71  Emacs                               0x000000010020652d Ffuncall + 1117 (eval.c:2775)
72  Emacs                               0x000000010027173a exec_byte_code + 3866 (bytecode.c:900)
73  Emacs                               0x0000000100207b6e funcall_lambda + 1566 (eval.c:3010)
74  Emacs                               0x00000001002067b2 Ffuncall + 1762 (eval.c:2827)
75  Emacs                               0x000000010027173a exec_byte_code + 3866 (bytecode.c:900)
76  Emacs                               0x0000000100207b6e funcall_lambda + 1566 (eval.c:3010)
77  Emacs                               0x00000001002067b2 Ffuncall + 1762 (eval.c:2827)
78  Emacs                               0x0000000100205b33 Fapply + 243 (eval.c:2255)
79  Emacs                               0x0000000100206403 Ffuncall + 819 (eval.c:2759)
80  Emacs                               0x000000010027173a exec_byte_code + 3866 (bytecode.c:900)
81  Emacs                               0x000000010027080f Fbyte_code + 63 (bytecode.c:475)
82  Emacs                               0x0000000100200e79 eval_sub + 2073 (eval.c:2149)
83  Emacs                               0x0000000100203d84 internal_lisp_condition_case + 772 (eval.c:1243)
84  Emacs                               0x0000000100272957 exec_byte_code + 8503 (bytecode.c:1096)
85  Emacs                               0x0000000100207b6e funcall_lambda + 1566 (eval.c:3010)
86  Emacs                               0x00000001002067b2 Ffuncall + 1762 (eval.c:2827)
87  Emacs                               0x00000001002070e9 call1 + 73 (eval.c:2572)
88  Emacs                               0x000000010013d6a6 timer_check_2 + 1846 (keyboard.c:4447)                   ;; First call
89  Emacs                               0x000000010013cef5 timer_check + 165 (keyboard.c:4514)
90  Emacs                               0x0000000100139c25 readable_events + 37 (keyboard.c:3405)
91  Emacs                               0x000000010013cdb6 get_input_pending + 54 (keyboard.c:6794)
92  Emacs                               0x00000001001382e6 detect_input_pending_run_timers + 54 (keyboard.c:10391)
93  Emacs                               0x0000000100280963 wait_reading_process_output + 4227 (process.c:4762)
94  Emacs                               0x00000001000087fa sit_for + 634 (dispnew.c:5981)
...

(I just wonder whether this behaviour is acceptable).

Dmitry






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#15561: Re: bug#15561: periodic timer stops running
  2014-02-28  8:03     ` bug#15561: " Dmitry Antipov
@ 2014-02-28  9:18       ` Eli Zaretskii
  2014-02-28 13:51         ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2014-02-28  9:18 UTC (permalink / raw
  To: Dmitry Antipov; +Cc: eggert, 15561

> Date: Fri, 28 Feb 2014 12:03:09 +0400
> From: Dmitry Antipov <antipov@dev.rtsoft.ru>
> Cc: 15561@debbugs.gnu.org
> 
> BTW, we have at least one backtrace with nested calls to timer_check_2 (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16817#11):

Perhaps we should bind Vtimer_list to nil when we call Lisp in
timer_check_2.

But in general, timer_check_2 works on a copy of Vtimer_list, so
calling it recursively is not necessarily a problem, I think.  Do you
see any potential problems?





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#15561: Re: bug#15561: periodic timer stops running
  2014-02-28  9:18       ` Eli Zaretskii
@ 2014-02-28 13:51         ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2014-02-28 13:51 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: eggert, Dmitry Antipov, 15561

>> BTW, we have at least one backtrace with nested calls to timer_check_2
>> (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16817#11):

That can clearly happen if a timer does things like sit-for.

> Perhaps we should bind Vtimer_list to nil when we call Lisp in
> timer_check_2.

No, because a timer may also want to schedule a new timer or cancel an
old one.


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-28 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAFM41H34WhVZ_fCWoh9BxDqs07OPXi_u=5ghTHkv_zAp22SxBA@mail.gmail.com>
2014-02-27 22:11 ` bug#15561: Fwd: bug#15561: periodic timer stops running Barry OReilly
     [not found] ` <530FF70C.2020905@cs.ucla.edu>
2014-02-28  2:42   ` Paul Eggert
2014-02-28  8:03     ` bug#15561: " Dmitry Antipov
2014-02-28  9:18       ` Eli Zaretskii
2014-02-28 13:51         ` Stefan Monnier

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.