From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Valery Ushakov Newsgroups: gmane.emacs.bugs Subject: bug#30738: Invalid timezone (tzalloc failure) treated as out-of-memory Date: Mon, 19 Mar 2018 19:29:43 +0300 Message-ID: <20180319162943.GN3278@pony.stderr.spb.ru> References: <1370cc81-6aea-ed58-fcc0-1adc32f4252c@cs.ucla.edu> <20180312191002.GA3278@pony.stderr.spb.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1521476893 26321 195.159.176.226 (19 Mar 2018 16:28:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Mar 2018 16:28:13 +0000 (UTC) User-Agent: Mutt/1.9.2 (2017-12-15) Cc: 30738@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 19 17:28:09 2018 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 1exxdo-0006lR-Rp for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Mar 2018 17:28:08 +0100 Original-Received: from localhost ([::1]:42924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exxfs-0006jR-2S for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Mar 2018 12:30:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exxfk-0006h9-DF for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 12:30:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exxfe-0003X1-Jz for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 12:30:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1exxfe-0003Wj-F8 for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 12:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1exxfd-0005GH-Ve for bug-gnu-emacs@gnu.org; Mon, 19 Mar 2018 12:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Valery Ushakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Mar 2018 16:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30738 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30738-submit@debbugs.gnu.org id=B30738.152147699520185 (code B ref 30738); Mon, 19 Mar 2018 16:30:01 +0000 Original-Received: (at 30738) by debbugs.gnu.org; 19 Mar 2018 16:29:55 +0000 Original-Received: from localhost ([127.0.0.1]:42069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exxfX-0005FV-L8 for submit@debbugs.gnu.org; Mon, 19 Mar 2018 12:29:55 -0400 Original-Received: from pony.stderr.spb.ru ([212.113.112.78]:63608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exxfV-0005FG-Mz for 30738@debbugs.gnu.org; Mon, 19 Mar 2018 12:29:54 -0400 Original-Received: by pony.stderr.spb.ru (Postfix, from userid 1000) id BBF741F0D29; Mon, 19 Mar 2018 19:29:43 +0300 (MSK) Content-Disposition: inline In-Reply-To: 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:144410 Archived-At: On Thu, Mar 15, 2018 at 09:43:20 -0700, Paul Eggert wrote: > On 03/12/2018 12:10 PM, Valery Ushakov wrote: > > - else if (EQ (zone, Qt)) > > + else if (EQ (zone, Qt) > > + || (INTEGERP (zone) && XINT (zone) == 0)) > > Thanks for diagnosing the problem. If I understand things correctly, we can > do a more-general fix, which should work for any used-in-practice time zone > that is an integer hour offset from UTC. I installed the attached patch into > master; please give it a try. Sorry, I still haven't got around to test it, but I used exactly the same approach with Etc/GMT* zones as a kludge when I first ran into this problem and needed a working emacs asap. I'll try to actually test your patch this week. I'd say special casing 0 is still a good idea as it saves a call to tzalloc(). I also suspect that zone == 0 from parsed-time-string is the most common case. -uwe