X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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 AT cygwin DOT com From: Brian Inglis 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: References: <55BA373A DOT 4020909 AT dronecode DOT org DOT uk> <55BB6F47 DOT 1000906 AT dronecode DOT org DOT uk> 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 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 > % 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