From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10420 invoked by alias); 26 Feb 2010 13:00:06 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 14894 Received: (qmail 21655 invoked from network); 26 Feb 2010 13:00:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.org does not designate permitted sender hosts) Date: Fri, 26 Feb 2010 13:52:56 +0100 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: segfault in strftime Message-ID: <20100226125256.GC13766@prunille.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.20-6045-vl-r30587 (2010-02-23) On 2010-02-26 13:08:48 +0100, Sebastian Stark wrote: > I just found that zsh segfaults when I do this: > > zmodload zsh/datetime > strftime "%a %d.%m.%Y %H:%M:%S" 67768036191673200 > > while it doesn't for smaller numbers, like: > > strftime "%a %d.%m.%Y %H:%M:%S" 67768036191673199 > > It will print a negative year for this value though. Negative results are not a big problem I think, but a segfault could be. > > I tried this with zsh-4.3.10 under linux-gnu-x86_64. Can anyone reproduce this? I can reproduce this under Debian/unstable (zsh 4.3.10). But under Mac OS X Tiger / PowerPC, with zsh 4.3.10: strftime: 67768036191673199: result too large probably because it is only 32 bits. But it seems that a large positive integer can be regarded as negative: $ strftime "%a %d.%m.%Y %H:%M:%S" 2776803611 Tue 22.11.1921 15:51:55 Also, it seems to have a problem with -1: Under Mac OS X: $ strftime "%a %d.%m.%Y %H:%M:%S" -2 Thu 01.01.1970 00:59:58 $ strftime "%a %d.%m.%Y %H:%M:%S" -1 strftime: -1: unknown error: 0 Under Linux/x86_64 (Debian/unstable): $ strftime "%a %d.%m.%Y %H:%M:%S" -2 Thu 01.01.1970 00:59:58 $ strftime "%a %d.%m.%Y %H:%M:%S" -1 strftime: -1: success -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)