From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9577 invoked by alias); 13 Sep 2006 04:38:38 -0000 Received: (qmail 9565 invoked by uid 22791); 13 Sep 2006 04:38:37 -0000 X-Spam-Check-By: sourceware.org Received: from rwcrmhc11.comcast.net (HELO rwcrmhc11.comcast.net) (216.148.227.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 13 Sep 2006 04:38:35 +0000 Received: from rmailcenter79.comcast.net ([204.127.197.179]) by comcast.net (rwcrmhc11) with SMTP id <20060913043833m11009llq9e>; Wed, 13 Sep 2006 04:38:33 +0000 Received: from [24.10.241.225] by rmailcenter79.comcast.net; Wed, 13 Sep 2006 04:38:33 +0000 From: ericblake@comcast.net (Eric Blake) To: cygwin@cygwin.com Subject: Re: bash-3.1-7 BUG Date: Wed, 13 Sep 2006 04:38:00 -0000 Message-Id: <091320060438.11140.45078B490008FD8600002B8422007610640A050E040D0C079D0A@comcast.net> X-Mailer: AT&T Message Center Version 1 (Apr 11 2006) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2006-09/txt/msg00226.txt.bz2 > At any rate, thanks for narrowing down your application > to a smaller test case; I'll see what I can find with it. Here's something interesting in the strace: 30 518741 [main] bash 2084 readv: readv (255, 0x22C060, 1) blocking, sigcatchers 1 30 518771 [main] bash 2084 readv: no need to call ready_for_read 34 518805 [main] bash 2084 fhandler_base::read: read 0 bytes () 29 518834 [main] bash 2084 fhandler_base::read: returning 135, text mode ... 33 1682871 [main] bash 2084 fhandler_base::lseek: lseek (/home/eblake/text/zzz.sh, -103, 1) 32 1682903 [main] bash 2084 fhandler_base::lseek: setting file pointer to 429 4967295 (high), 4294967193 (low) 34 1682937 [main] bash 2084 lseek64: 39 = lseek (255, -103, 1) Seems like a text mode lseek bug (no surprise there, since cgf predicted that there are still some corner cases). The file is 142 bytes, but has seven \r\n pairs, so the readv correctly returned 135 characters read. But the lseek back to the start of the third line temporarily set the file pointer to -3, then settled on an offset of 39 (39 + 103 gives 142 bytes, as if in binary mode); the offset really should have been 32 characters in (byte 34 is the start of the third line, so two \r would be skipped at that point). I'm still not sure if it is bash's fault or cygwin's. But the file definitely was read in text mode when it resided in a text mount. -- Eric Blake -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/