From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4927 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: asctime(0) Segmentation fault Date: Sat, 19 Apr 2014 23:35:36 -0400 Message-ID: <20140420033536.GW26358@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1397964956 22165 80.91.229.3 (20 Apr 2014 03:35:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Apr 2014 03:35:56 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4931-gllmg-musl=m.gmane.org@lists.openwall.com Sun Apr 20 05:35:50 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 1WbiXl-0005ao-4d for gllmg-musl@plane.gmane.org; Sun, 20 Apr 2014 05:35:49 +0200 Original-Received: (qmail 32679 invoked by uid 550); 20 Apr 2014 03:35:48 -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 32671 invoked from network); 20 Apr 2014 03:35:48 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:4927 Archived-At: On Sat, Apr 19, 2014 at 11:33:06PM -0400, John Mudd wrote: > Yes, asctime(0) might be my bad assumption. > > Does this help? > > (gdb) backtrace > #0 a_crash () at ./arch/i386/atomic.h:124 > #1 0xb7fc735b in __asctime (tm=0xbfffde64, buf=0xb7fff288 "Mon > Jan 1 00:00:00 12345") at src/time/__asctime.c:26 > #2 0xb7fc91d7 in asctime (tm=tm@entry=0xbfffde64) at src/time/asctime.c:8 > #3 0xb7c89709 in time_asctime (self=0x0, args=0xb7d05bcc) at > /home/mudd/musl/Python-2.7.6/Modules/timemodule.c:574 > #4 0xb7e1989d in PyCFunction_Call (func=func@entry=0xb7d056cc, > arg=arg@entry=0xb7d05bcc, kw=kw@entry=0x0) at Objects/methodobject.c:81 Yes. musl's asctime is intentionally crashing when the resulting string would be >26 bytes rather than silently clobbering whatever memory lies just beyond the end of the static buffer. Rich