From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11908 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl's asctime catches Python bug Date: Mon, 4 Sep 2017 20:08:26 -0400 Message-ID: <20170905000826.GO1627@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1504570149 526 195.159.176.226 (5 Sep 2017 00:09:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Sep 2017 00:09:09 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11921-gllmg-musl=m.gmane.org@lists.openwall.com Tue Sep 05 02:08:54 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dp1Pu-0006yg-M2 for gllmg-musl@m.gmane.org; Tue, 05 Sep 2017 02:08:34 +0200 Original-Received: (qmail 17575 invoked by uid 550); 5 Sep 2017 00:08:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 17556 invoked from network); 5 Sep 2017 00:08:38 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11908 Archived-At: On Mon, Sep 04, 2017 at 07:27:08PM -0400, jacob@welshcomputing.com wrote: > >I've been working through the Python test suite (2.7.13) on musl > >(1.1.16). There were a couple over-zealous tests involving errno, > >and locale tests that I'd expect to fail, but one set of failures > >I haven't yet been able to rule out as a musl bug. > > There was another bug that I didn't want to mention until Python > security had a chance to respond: undefined behavior in their > asctime()/ctime() wrappers for year > 9999, found by virtue of > musl's use of a_crash to highlight the problem. > > The public discussion is at https://bugs.python.org/issue31339 if > anyone's interested. I didn't see a direct link to the fix anywhere, but it's pretty clear that the right thing to do is call strftime (a clean interface that lacks global state and thread-safety problems) and/or strftime_l and never use ctime/asctime. Rich