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:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type; q=dns; s=default; b=QV
	jltdmeMx1tNXWrpT+QmF0O3dCQxzIQYnsLzm2flEaz2XNpFuHuxVD5LeIEvb4MS+
	RBSinNP0KpxG2EDTekl1y+jkU6cmah5hki3zu7ZBWtXnRuUYUgNGDsicHhpb5Dut
	LQRlyRkOr1Xmn64dhwHfhUgt3uWvgd4OK4ihVq79U=
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:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type; s=default; bh=IzL93Iz9
	I60HR5ktD214X+Vi0EY=; b=pUSbhDl+ShW9Ove+lwc0WPnDmwlMg6fbyxno8hJX
	fyV35PBxY14KMqqdEibaq34C//qX+RpVi7TzfNCoXY7VKMSAHucBumeEd5MihXrU
	NhhPZXG23+zjB+VFrDvhVayulfdaA8fkEOLnB5s9BykoqnU6kA6dE5OQXvGFG0js
	jmw=
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.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-lb0-f179.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20130820;        h=x-gm-message-state:mime-version:in-reply-to:references:date         :message-id:subject:from:to:content-type;        bh=83U8euo/C8lbbITbHbkiXt+vJweqNSEO8+5o3HEK/vY=;        b=a7tBset6D4wFPuS4sUdmqlD36SSlvs9XRrKz+it9keyfh7xDuE6g2bvqMd2QQq4dbB         l0C8+7Ndk4gkJWqlYRepgk/L3cPzms7LIPFeIzgSkNQJLmFKNyQrgtskDiBhgj9U+CRx         oK9wtdr9CH2I7tbpfxqc4w/sNiiEKB3TEaaZcheTsByK33OQrCbVMHT+yQT3qNxGh0gV         K8tOxCdMUl6fDk7Ixx08WfE6RGAfC5O+sMobO8tmoeoiVeZj8f8IIXVzCPbIc1I23hsp         UwAePZai3dkk3K9CAprS9IqRgx/dXWU07ZngrGiqH+PINy43HDS1AXBe69Za+6QPJM1z         YjVA==
X-Gm-Message-State: ALoCoQm44O/AqTbemShV6/5FV+JApkMPpURY9E61SnJg7IFIP7iXasahpHoVYXTPWFOePLGlJFnG
MIME-Version: 1.0
X-Received: by 10.112.209.106 with SMTP id ml10mr10292308lbc.112.1438480501887; Sat, 01 Aug 2015 18:55:01 -0700 (PDT)
In-Reply-To: <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>	<loom.20150801T222419-312@post.gmane.org>
Date: Sat, 1 Aug 2015 18:55:01 -0700
Message-ID: <CAOC2fq8T0Ga0Xj_1R5RZ_Tog_JKc5_Dw23pomAFzUkVcC=ZxUg@mail.gmail.com>
Subject: Re: Analyzing a SEG FAULT that gdb doesn't help with
From: Michael Enright <mike@kmcardiff.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes

On Sat, Aug 1, 2015 at 1:28 PM, Brian Inglis  wrote:
>
> 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.
>
Well this code is not related to the strftime code in my other thread.
In this case it was just that a programmer didn't understand why
people do printf("%s",string) instead of printf(string). The program
takes lines out of log files, snarfs information out of them and makes
a report. Sometimes what belongs in the report is a copy of the entire
line from the log, so printf(line). But that would seem unwise in
general. In particular these log lines have prompts in them, and as
you know prompts often have '%' characters in them. It was only a
matter of time before this habit became a bad one.

So my email above is really the conclusion of the investigation, and
the fix is for me to switch the code to fputs in such cases.

--
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

