This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Analyzing a SEG FAULT that gdb doesn't help with
- From: Brian Inglis <Brian dot Inglis at SystematicSw dot ab dot ca>
- To: cygwin at cygwin dot com
- Date: Sat, 1 Aug 2015 20:28:02 +0000 (UTC)
- Subject: Re: Analyzing a SEG FAULT that gdb doesn't help with
- Authentication-results: sourceware.org; auth=none
- References: <CAOC2fq_fahjLapKbgO8Xer8neEjv1Ohs4bM3JOWcka0ajjcbCg at mail dot gmail dot com> <55BA373A dot 4020909 at dronecode dot org dot uk> <55BB6F47 dot 1000906 at dronecode dot org dot uk> <CAOC2fq89HuStOLzEO9MxFZHBd54vmYfvp4juQyMKkNGkYG_D_g at mail dot gmail dot com> <CAOC2fq-DHmzwkv5CcnqzQ-VG0fTy_5X0pnc6pPTWVbRvhOzaGQ at mail dot gmail dot com>
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