public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: bash-3.1-7^[$B!!^[(BBUG
@ 2006-09-13  4:38 Eric Blake
  2006-09-13  5:25 ` bash-3.1-7^[$B!!^[(BBUG Christopher Faylor
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Blake @ 2006-09-13  4:38 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 25+ messages in thread
* Re: bash-3.1-7^[$B!!^[(BBUG
@ 2006-09-13  4:13 Eric Blake
  0 siblings, 0 replies; 25+ messages in thread
From: Eric Blake @ 2006-09-13  4:13 UTC (permalink / raw)
  To: Kazuyuki Hagiwara, cygwin

> I have extracted very short script which fails by bash-3.1-7,
> while runs successfully 3.1-6 ofcorse.
> 
> While the attached script zzz.sh has \r\n style end of line format,
> it shoud run normally since accessed through "text mount" point.

Does it work if you convert it to \n line endings, using d2u?

> [~/work] mount | grep tmp
> D:\users\hagiwara\tmp on /tmp type user (binmode)
> D:\users\hagiwara\tmp on /tmp2 type system (textmode)

Why are you mounting the same physical directory to two
different posix paths with different options?  I'm not sure
that will always work the way you expect, although I doubt
it explains the problems you are seeing.

At any rate, thanks for narrowing down your application
to a smaller test case; I'll see what I can find with it.  Any
chance you can convince your mailer to send text files
with a text mime type?  In the meantime, since 3.1-7 is
marked experimental and was not working for you, you
are under no obligation to use it.

-- 
Eric Blake
volunteer cygwin bash maintainer

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

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

end of thread, other threads:[~2006-09-21  3:50 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-13  4:38 bash-3.1-7^[$B!!^[(BBUG Eric Blake
2006-09-13  5:25 ` bash-3.1-7^[$B!!^[(BBUG Christopher Faylor
2006-09-13 14:33   ` bash-3.1-7^[$B!!^[(BBUG Eric Blake
2006-09-13 20:07     ` bash-3.1-7^[$B!!^[(BBUG Shankar Unni
2006-09-13 20:37       ` bash-3.1-7^[$B!!^[(BBUG mwoehlke
2006-09-13 21:48         ` bash-3.1-7^[$B!!^[(BBUG Eric Blake
2006-09-13 22:08           ` bash-3.1-7^[$B!!^[(BBUG mwoehlke
2006-09-13 23:46             ` bash-3.1-7^[$B!!^[(BBUG Volker Quetschke
2006-09-13 23:58               ` bash-3.1-7^[$B!!^[(BBUG David Rothenberger
2006-09-14  0:30                 ` bash-3.1-7^[$B!!^[(BBUG Larry Hall (Cygwin)
2006-09-18  2:48                   ` bash-3.1-7^[$B!!^[(BBUG Carlo Florendo
2006-09-18  2:54                     ` bash-3.1-7^[$B!!^[(BBUG Carlo Florendo
2006-09-14  0:19               ` bash-3.1-7^[$B!!^[(BBUG Christopher Faylor
2006-09-14  1:09                 ` bash-3.1-7^[$B!!^[(BBUG Volker Quetschke
2006-09-14  2:07                   ` bash-3.1-7^[$B!!^[(BBUG Christopher Faylor
2006-09-14 11:13                     ` bash-3.1-7^[$B!!^[(BBUG Eric Blake
2006-09-14 16:58                       ` bash-3.1-7^[$B!!^[(BBUG Volker Quetschke
2006-09-14 17:15                         ` bash-3.1-7^[$B!!^[(BBUG Dave Korn
2006-09-14 17:22                           ` bash-3.1-7^[$B!!^[(BBUG Volker Quetschke
2006-09-14 17:26                         ` bash-3.1-7^[$B!!^[(BBUG Eric Blake
2006-09-21  3:50                         ` bash-3.1-7^[$B!!^[(BBUG Christopher Layne
2006-09-14 15:21                     ` bash-3.1-7 bug mwoehlke
2006-09-21  3:48                     ` bash-3.1-7^[$B!!^[(BBUG Christopher Layne
2006-09-21  3:37                 ` bash-3.1-7^[$B!!^[(BBUG Christopher Layne
  -- strict thread matches above, loose matches on Subject: below --
2006-09-13  4:13 bash-3.1-7^[$B!!^[(BBUG Eric Blake

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