unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33380: 27.0.50; Emacs hangs in current-time-zone
@ 2018-11-14 14:22 Sam Steingold
  2018-11-14 18:49 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Steingold @ 2018-11-14 14:22 UTC (permalink / raw)
  To: 33380

In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.7.0, NS
appkit-1561.60 Version 10.13.6 (Build 17G3025))
 of 2018-11-12 built on C-6111-SSTEINGO
Repository revision: db711687c3983eda60275dadcc4dc75119e6c0ae
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1561
System Description:  Mac OS X 10.13.6

When I hit `d` in Calendar, Emacs hangs, and debug-on-quit reveals the
backtrace:

Debugger entered--Lisp error: (quit)
  current-time-zone(-242240400)
  calendar-next-time-zone-transition((-3852 1873))
  calendar-dst-find-data((-3852 1873))
  calendar-dst-find-startend(1962)
  calendar-dst-starts(1962)
  eval((calendar-dst-starts year))
  dst-in-effect(716571.289583333)
  dst-adjust-time((11 27 1962) 6.94794218501546)
  solar-sunrise-sunset((11 27 1962))
  solar-sunrise-sunset-string((11 27 1962))
  diary-sunrise-sunset()
  eval((diary-sunrise-sunset))
  diary-sexp-entry("(diary-sunrise-sunset)" "" (11 27 1962))
  diary-list-sexp-entries((11 27 1962))
  diary-list-entries((11 27 1962) 1)
  diary-view-entries(1)
  funcall-interactively(diary-view-entries 1)
  call-interactively(diary-view-entries nil nil)
  command-execute(diary-view-entries)

this does not happen with "current" dates.


-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net>
<http://steingoldpsychology.com>





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

* bug#33380: 27.0.50; Emacs hangs in current-time-zone
  2018-11-14 14:22 bug#33380: 27.0.50; Emacs hangs in current-time-zone Sam Steingold
@ 2018-11-14 18:49 ` Glenn Morris
  2018-11-14 22:26   ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2018-11-14 18:49 UTC (permalink / raw)
  To: Sam Steingold; +Cc: 33380, eggert

Sam Steingold wrote:

> When I hit `d` in Calendar, Emacs hangs,

A smaller example is to evaluate: (calendar-dst-starts 1962)

Bisection points to 93fe420942c08111a6048af7c4d7807c61d80a09,
"New (TICKS . HZ) timestamp format".





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

* bug#33380: 27.0.50; Emacs hangs in current-time-zone
  2018-11-14 18:49 ` Glenn Morris
@ 2018-11-14 22:26   ` Paul Eggert
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Eggert @ 2018-11-14 22:26 UTC (permalink / raw)
  To: Glenn Morris, Sam Steingold; +Cc: 33380-done

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

On 11/14/18 10:49 AM, Glenn Morris wrote:
> A smaller example is to evaluate: (calendar-dst-starts 1962)

Thanks for the smaller example. I installed the attached patch into 
master to fix that and am optimistically marking this bug as done. And 
thanks, Sam, for reporting the original problem.


[-- Attachment #2: 0001-Fix-probing-for-pre-1970-DST.patch --]
[-- Type: text/x-patch, Size: 1087 bytes --]

From 917fe0d0383eabf621f59a7314882423bc12f74a Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
Date: Wed, 14 Nov 2018 11:42:59 -0800
Subject: [PATCH] Fix probing for pre-1970 DST

* lisp/calendar/cal-dst.el (calendar-next-time-zone-transition):
Fix recently-introduced rounding bug when probing for DST
transitions before 1970 (Bug#33380).
---
 lisp/calendar/cal-dst.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 25264bda09..8392e81b16 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -154,7 +154,7 @@ calendar-next-time-zone-transition
        (while
            ;; Set PROBE to halfway between LO and HI, rounding down.
            ;; If PROBE equals LO, we are done.
-           (not (= lo (setq probe (/ (+ lo hi) 2))))
+           (not (= lo (setq probe (floor (+ lo hi) 2))))
          ;; Set either LO or HI to PROBE, depending on probe results.
          (if (eq (car (current-time-zone probe)) hi-utc-diff)
              (setq hi probe)
-- 
2.19.1


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

end of thread, other threads:[~2018-11-14 22:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-14 14:22 bug#33380: 27.0.50; Emacs hangs in current-time-zone Sam Steingold
2018-11-14 18:49 ` Glenn Morris
2018-11-14 22:26   ` Paul Eggert

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).