From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4924 Path: news.gmane.org!not-for-mail From: John Mudd Newsgroups: gmane.linux.lib.musl.general Subject: Re: asctime(0) Segmentation fault Date: Sat, 19 Apr 2014 22:51:34 -0400 Message-ID: References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c26692239d4f04f7707747 X-Trace: ger.gmane.org 1397962331 30070 80.91.229.3 (20 Apr 2014 02:52:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Apr 2014 02:52:11 +0000 (UTC) To: musl Original-X-From: musl-return-4928-gllmg-musl=m.gmane.org@lists.openwall.com Sun Apr 20 04:52:06 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WbhrS-000234-3G for gllmg-musl@plane.gmane.org; Sun, 20 Apr 2014 04:52:06 +0200 Original-Received: (qmail 11768 invoked by uid 550); 20 Apr 2014 02:52:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11760 invoked from network); 20 Apr 2014 02:52:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=hdql8UfbmMxJ4wBVTsqaxQx1xAw6gSVPBEaheq1ibHI=; b=xE9/2IpcESJTHyVTH2HOgTEt7ESo447UhsAzVU/S/1YUkEdbx3MJKbawUnrk13Jt3q llPsYCxldG6tozsvNozXiZ160CHhD3kQHTj3DVMpgl62kadqlfa3GDxAHHJpXH7jVwcL lstWv250a5ufYoVt1GGgwf/CcXW/+Bh/7IsIrOo9qkVTVJdoVCcXHW9aI2Fgohj6I6gS IJgTRYr7nTOsDoHZpG7osHceX2juRG+nf7fTgy7oiVaGhR2xKzl1Pm3gRy3N2Q+Fue0Z TPpVOUfDtgL4/mfHWZERZU/Y8hIThHCClWt8+VQHqUf+2WITfb0z80WAbS0BgFVKSfm4 mZWg== X-Received: by 10.112.139.166 with SMTP id qz6mr17042339lbb.13.1397962314061; Sat, 19 Apr 2014 19:51:54 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:4924 Archived-At: --001a11c26692239d4f04f7707747 Content-Type: text/plain; charset=ISO-8859-1 That was incomplete. >From Python-2.7.6/Lib/test/test_time.py: def test_asctime(self): time.asctime(time.gmtime(self.t)) self.assertRaises(TypeError, time.asctime, 0) self.assertRaises(TypeError, time.asctime, ()) # XXX: Posix compiant asctime should refuse to convert # year > 9999, but Linux implementation does not. # self.assertRaises(ValueError, time.asctime, # (12345, 1, 0, 0, 0, 0, 0, 0, 0)) # XXX: For now, just make sure we don't have a crash: try: time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0)) except ValueError: pass >>> import time >>> time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0)) 'Mon Jan 1 00:00:00 12345\n' >>> musl: >>> import time >>> time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0)) Segmentation fault (core dumped) On Sat, Apr 19, 2014 at 10:43 PM, John Mudd wrote: > From Python-2.7.6/Lib/test/test_time.py: > > > --001a11c26692239d4f04f7707747 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
That was incomplete.

From Python-= 2.7.6/Lib/test/test_time.py:

=A0 =A0 def test_ascti= me(self):
=A0 =A0 =A0 =A0 time.asctime(time.gmtime(self.t))
=
=A0 =A0 =A0 =A0 self.assertRaises(TypeError, time.asctime, 0)
=A0 =A0 =A0 =A0 self.assertRaises(TypeError, time.asctime, ())
=A0 =A0 =A0 =A0 # XXX: Posix compiant asctime should refuse to convert
=A0 =A0 =A0 =A0 # year > 9999, but Linux implementation does no= t.
=A0 =A0 =A0 =A0 # self.assertRaises(ValueError, time.asctime,<= /div>
=A0 =A0 =A0 =A0 # =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(12345, 1, 0, 0, = 0, 0, 0, 0, 0))
=A0 =A0 =A0 =A0 # XXX: For now, just make sure we= don't have a crash:
=A0 =A0 =A0 =A0 try:
=A0 =A0 = =A0 =A0 =A0 =A0 time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0))
=A0 =A0 =A0 =A0 except ValueError:
=A0 =A0 =A0 =A0 =A0 =A0 p= ass



>>>= ; import time
>>> time.asctime((12345, 1, 1, 0, 0, 0, 0,= 1, 0))
'Mon Jan =A01 00:00:00 12345\n'
>>>=A0

musl:
>>> import time
>>> time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0))
Seg= mentation fault (core dumped)



On Sat, Apr 19, 2014 at 10:43 PM, John Mudd <johnbmudd@gmail.com> wrote:
From Python-2.7.6/Lib/test/= test_time.py:


--001a11c26692239d4f04f7707747--