This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Analyzing a SEG FAULT that gdb doesn't help with

Michael Enright <mike <at>> 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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]