From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#27706: MacOS: decode-time hang Date: Sun, 01 Oct 2017 11:27:38 +0200 Message-ID: References: <20170930202102.GA885@breton.holly.idiocy.org> <87d167evbm.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506850153 24147 195.159.176.226 (1 Oct 2017 09:29:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Oct 2017 09:29:13 +0000 (UTC) Cc: alan@idiocy.org, 27706@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 01 11:29:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyaYc-0005Sz-9t for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Oct 2017 11:29:06 +0200 Original-Received: from localhost ([::1]:47659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyaYi-0004MI-4s for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Oct 2017 05:29:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyaYc-0004M2-9l for bug-gnu-emacs@gnu.org; Sun, 01 Oct 2017 05:29:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyaYY-00021x-MP for bug-gnu-emacs@gnu.org; Sun, 01 Oct 2017 05:29:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33059) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyaYY-00021Q-Em for bug-gnu-emacs@gnu.org; Sun, 01 Oct 2017 05:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dyaYX-00089L-Rn for bug-gnu-emacs@gnu.org; Sun, 01 Oct 2017 05:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Oct 2017 09:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27706 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27706-submit@debbugs.gnu.org id=B27706.150685010031269 (code B ref 27706); Sun, 01 Oct 2017 09:29:01 +0000 Original-Received: (at 27706) by debbugs.gnu.org; 1 Oct 2017 09:28:20 +0000 Original-Received: from localhost ([127.0.0.1]:41740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyaXr-00088H-Vo for submit@debbugs.gnu.org; Sun, 01 Oct 2017 05:28:20 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:44205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyaXq-000880-4C for 27706@debbugs.gnu.org; Sun, 01 Oct 2017 05:28:18 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 98D302255E for <27706@debbugs.gnu.org>; Sun, 1 Oct 2017 09:21:44 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-type:content-type:mime-version:references:subject :subject:in-reply-to:to:from:from:message-id:date:date; s=dkim; t=1506849703; x=1507713704; bh=bqq8VomhN9QrQJGxdeFKueft0+jefX6H r6XnUUZmR9Q=; b=Puh3imFqPJcCL67byo1zf8rbp9t+MAfLjl3oRksV12NDTgdD ezYXbXq7DYXQVGsgf1M4mQLGkoleVmOOAVV8SpQ2IjdCuBntCRMuVtN/TxkO14PP DKJ6s5TUlp+l+flmyzmc08qEEh4dKTXhxlss+pvBkq16KGDguMvRRVaytO0= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qhTSNL8nnHMd for <27706@debbugs.gnu.org>; Sun, 1 Oct 2017 09:21:43 +0000 (UTC) Original-Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 8001622550; Sun, 1 Oct 2017 09:21:40 +0000 (UTC) In-reply-to: <87d167evbm.fsf@users.sourceforge.net> (message from Noam Postavsky on Sat, 30 Sep 2017 17:21:49 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137737 Archived-At: > From: Noam Postavsky > Date: Sat, 30 Sep 2017 17:21:49 -0400 > > Alan Third writes: > > > (string-equal system-type "darwin") > > `system-type' contains a symbol, so generally the comparison should look > like this (unless there is some strong reason to do string comparison) > > (eq system-type 'darwin) Thanks to both of you for your help. Updated patch follows. I've also made the check a bit easier to read, and verified that it also works on the Darwin terminal. >From 7ddfdae2359c07bdddeeeafd69517e02ee3ee2f5 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Sat, 30 Sep 2017 20:42:03 +0200 Subject: [PATCH] Workaround for faulty localtime() under macOS 10.6 * lisp/org/org-clock.el (org-clock--oldest-date): Only execute 'decode-time' on times later than year -2**31 under macOS 10.6. See Bug#27706. --- lisp/org/org-clock.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index 8df185d..2eec817 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -478,7 +478,17 @@ org-clock--oldest-date (funcall dichotomy most-negative-fixnum 0 - (lambda (m) (ignore-errors (decode-time (list m 0)))))) + (lambda (m) + ;; libc in macOS 10.6 hangs when decoding times + ;; around year -2**31. Limit `high' not to go + ;; any earlier than that. + (unless (and (eq system-type 'darwin) + (string-match-p + "10\\.6\\.[[:digit:]]" + (shell-command-to-string + "sw_vers -productVersion")) + (<= m -1034058203136)) + (ignore-errors (decode-time (list m 0))))))) (low (funcall dichotomy most-negative-fixnum -- 2.9.4