From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107820 invoked by alias); 11 Mar 2016 19:17:08 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 107803 invoked by uid 89); 11 Mar 2016 19:17:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Mac, buffering, HX-PHP-Originating-Script:501, stdio X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.139) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Mar 2016 19:16:57 +0000 Received: from kylheku.com ([24.85.175.81]) by shaw.ca with SMTP id eSYPaPqkm0h8NeSYQafTgW; Fri, 11 Mar 2016 12:16:55 -0700 X-Authority-Analysis: v=2.1 cv=VIR9547X c=1 sm=1 tr=0 a=WiYoHcCliNeVponEdG0Ckg==:117 a=WiYoHcCliNeVponEdG0Ckg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=7OsogOcEt9IA:10 a=uPZiAMpXAAAA:8 a=2KUf1mbJAAAA:8 a=TKfZGsrgrFnpe2WQR6cA:9 a=QEXdDO2ut3YA:10 Received: from www-data by kylheku.com with local (Exim 4.72) (envelope-from <920-082-4242@kylheku.com>) id 1aeSYO-0004KH-HU for cygwin@cygwin.com; Fri, 11 Mar 2016 11:16:52 -0800 To: cygwin@cygwin.com Subject: Problem with line buffering and getc function on 1.7.33. X-PHP-Originating-Script: 501:rcmail.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Date: Fri, 11 Mar 2016 19:17:00 -0000 From: Kaz Kylheku <920-082-4242@kylheku.com> Message-ID: X-Sender: 920-082-4242@kylheku.com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4wfHoUPYWa01kgU6GvOuWcCxeF0GA9BJliomskogeoOY0bmWI1935yhNhalqNl+nnrTZb5b6OCKqRFhrWB9dxmaDOujAzv2LYkaWUyMYy+9MzxSHe8uUim /iLCd9iDolAiC1Aos549iy3rPg11J8BW7YpOccVERAKdHXXshc79fz+D X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00171.txt.bz2 Hi all, On a Cygwin installation version 1.7.33-2(0.280/5/3), I encountered an=20 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=20 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=20 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=3D3c5f110cc29f8d3fbf2069c68d25cc= ebee46679e 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