From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4794 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: printf issues Date: Fri, 4 Apr 2014 17:08:37 -0400 Message-ID: <20140404210837.GS26358@brightrain.aerifal.cx> References: <20140404141515.GD3034@port70.net> <20140404150705.GN26358@brightrain.aerifal.cx> <20140404185413.GH3034@port70.net> 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 1396645736 20742 80.91.229.3 (4 Apr 2014 21:08:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2014 21:08:56 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4798-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 04 23:08: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 1WWBM1-0001pT-TB for gllmg-musl@plane.gmane.org; Fri, 04 Apr 2014 23:08:50 +0200 Original-Received: (qmail 3297 invoked by uid 550); 4 Apr 2014 21:08:49 -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 3289 invoked from network); 4 Apr 2014 21:08:49 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4794 Archived-At: On Fri, Apr 04, 2014 at 04:22:46PM -0400, Morten Welinder wrote: > Another printf issue has shown up, this time with memory corruption. > > printf ("%.3E\n", 999999999.0); > > The rounding test correctly decides that it needs to round this value > up to 1E+09. It is, however, utterly unprepared for having nowhere to > put the carry. It happily accesses and changes one or more elements > before the one that held 999999999. I suspect this may be true; if so, it's a very nice catch. Were you able to determine what data it clobbers (in practice; obviously this is compiler-specific) and whether the clobber has any observable effects? Rich