public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Problem with line buffering and getc function on 1.7.33.
@ 2016-03-11 21:57 Kaz Kylheku
  2016-03-11 22:14 ` Marco Atzeri
  0 siblings, 1 reply; 12+ messages in thread
From: Kaz Kylheku @ 2016-03-11 21:57 UTC (permalink / raw)
  To: cygwin

On 11.03.2016 12:08, Yaakov Selkowitz wrote:
> On 2016-03-11 13:16, Kaz Kylheku wrote:
> 
>> On a Cygwin installation version 1.7.33-2(0.280/5/3), I encountered an 
>> odd issue.
> 
> This is a 15-month old release which is no longer supported. Please
> update to 2.4.1.

Do you mean, "Please update to 2.4.1, it is fixed there!"
or do you mean "You haven't done enough with that minimal
C repro case; please keep investigating against
the latest code?"

I'm not looking for support for old versions of Cygwin.
My program *is* supported for users who have that
15-month-old version, and I can provide that support
entirely by myself, as you can see.

There is no benefit to me in reporting this issue
at all, since the workaround is acceptable and will
likely keep working indefinitely.



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

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Problem with line buffering and getc function on 1.7.33.
@ 2016-03-11 19:17 Kaz Kylheku
  2016-03-11 20:09 ` Yaakov Selkowitz
  0 siblings, 1 reply; 12+ messages in thread
From: Kaz Kylheku @ 2016-03-11 19:17 UTC (permalink / raw)
  To: cygwin

Hi all,

On a Cygwin installation version 1.7.33-2(0.280/5/3), I encountered an 
odd issue.

I wrote it up in a StackOverflow question:

http://stackoverflow.com/questions/35928828/cygwin-missing-stream-data-due-to-stdio-putc-line-buffering

This contains a repro test case.

For the benefit of non-users of WWW, the summary is this:
I'm sending data to a stdio stream which has been fdopen-ed from a 
socket
descriptor (which could be irrelevant). The stream is put into line
buffered mode with setvbuf.  When the getc function is used to perform
output on this stream, it loses data. When the string "REPLY\n" is sent,
character by character, the receiver receives only "\n".

If line buffering is not employed, or of putc(ch, stream) is replaced
by fputs(str, stream) (where str is a one-character-long string 
containing
the character to be output), then things work as expected.

Here is a patch I put into the real program where this issue was
found:

http://www.kylheku.com/cgit/txr/commit/?id=3c5f110cc29f8d3fbf2069c68d25ccebee46679e

with the patch, TXR's socket test cases pass on Cygwin.
The tests pass on Solaris 10, various GNU/Linuxes and Mac OS 10.7.3.




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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-03-13 11:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-11 21:57 Problem with line buffering and getc function on 1.7.33 Kaz Kylheku
2016-03-11 22:14 ` Marco Atzeri
2016-03-12  0:05   ` Kaz Kylheku
2016-03-12 19:39     ` Corinna Vinschen
2016-03-12 22:29       ` Corinna Vinschen
2016-03-13  0:37         ` Kaz Kylheku
2016-03-13 10:47           ` Corinna Vinschen
2016-03-13  0:41         ` Kaz Kylheku
2016-03-13 11:06           ` Corinna Vinschen
2016-03-13 11:37             ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2016-03-11 19:17 Kaz Kylheku
2016-03-11 20:09 ` Yaakov Selkowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).