X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; q=dns; s=
	default; b=dueH8c5kQWOeWjD7MYC/ijmD6B5g+vVp3FrQI6/KnC3cgtWT+2mH7
	kBBUlH7bDEPjmWCRg8yJEVHk46/WKOWMJPtazgzxFT+6TAwzG2Ly9E4A5Gks5ett
	tfIk9xQ0RAOPBwezzNm/ta0Vd8LuU8aGCM7SMkW3gm05sM91RZWPXo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; s=default;
	 bh=1XN24TRF1f5HimCqC6WiHRGW/lk=; b=NcmRsDjF3Gicu1jrwWgsTiydt97R
	WnekX9AnJud1xprjhDOuqBl/N4mcJVdK48NhfODYCFOgZO8rmeris9LTPi+1l7YH
	HBRDBGyMXllIG6Fd8HppbxpA1hHLmG44w7uXqjjceh9b5JtM0xFGVwx9bevkXFrJ
	AEsSdv7Weg6Ubmw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2
X-HELO: plane.gmane.org
To: cygwin@cygwin.com
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Subject: Re: Analyzing a SEG FAULT that gdb doesn't help with
Date: Sat, 1 Aug 2015 20:28:02 +0000 (UTC)
Lines: 25
Message-ID: <loom.20150801T222419-312@post.gmane.org>
References: <CAOC2fq_fahjLapKbgO8Xer8neEjv1Ohs4bM3JOWcka0ajjcbCg@mail.gmail.com>	<55BA373A.4020909@dronecode.org.uk>	<55BB6F47.1000906@dronecode.org.uk>	<CAOC2fq89HuStOLzEO9MxFZHBd54vmYfvp4juQyMKkNGkYG_D_g@mail.gmail.com> <CAOC2fq-DHmzwkv5CcnqzQ-VG0fTy_5X0pnc6pPTWVbRvhOzaGQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

Michael Enright <mike <at> kmcardiff.com> writes:
> On Fri, Jul 31, 2015 at 11:46 AM, Michael Enright wrote:
> > On Fri, Jul 31, 2015 at 5:51 AM, Jon TURNEY wrote:
> The program in question is passing strings to printf that (a) end with
> "% " or (b) in the middle have "% S". To be clear these strings are
> the sole argument so they are format strings. This happens tons of
> times during a run but eventually it crashes in printf, generating a
> stackdump unless the magic setting is set.
> 
> As I read the posix spec, % can be followed by flags and space is
> actually a flag. This flag affects how signs are handled for numeric
> output. So it could be that the code is trying to deal with
> %<flag><conversion-char> and S is not a valid conversion char. My
> attempts to reproduce this outside the evil program have not worked.
> The output is a little crazy when you printf("something % Something")
> but in my test program it doesn't crash. I tried printing the strings
> that the real program might have to deal with but this didn't cause a
> crash either.

Seems like the problem may be developer confusion between strftime and
printf conversion flag prefixes. The strftime space conversion flag
character is _ so space filled seconds should use %_S, whereas the printf
conversion flag character is space ' ', though I can't recall ever using
that, as it is normally the default. 



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

