delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/12/19/10:29:01

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 19 Dec 2008 16:28:08 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin 1.7 domains and home directories
Message-ID: <20081219152808.GU6830@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <9f3df1acecdb14494f593ecc70fc8f0f DOT squirrel AT mail DOT morrison DOT mine DOT nu> <m43ik45dn7ejau88csatee7hsrbugqjc8q AT 4ax DOT com> <20081217170933 DOT GR6830 AT calimero DOT vinschen DOT de> <4rbnk4lleahcshvf2rejdtd6mfolang3e1 AT 4ax DOT com>
MIME-Version: 1.0
In-Reply-To: <4rbnk4lleahcshvf2rejdtd6mfolang3e1@4ax.com>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Dec 19 09:38, Andrew Schulman wrote:
> > On Dec 17 09:39, Andrew Schulman wrote:
> > > After a reboot, I ran
> > > 
> > > strace -o strace.txt c:\cygwin-1.7\bin\bash.exe --login
> > > 
> > > and observed the error in the shell that started.  The strace output is at
> > > http://home.comcast.net/~aschulman2/cygwin-1.7/strace.txt.bz2 .
> > 
> > Thanks for the strace.  It's missing some information I need to track
> > this down, so I created another DLL with some more debug output.  I sent
> > you the URL in PM.  It would be nice if you could retry to create strace
> > output using that DLL.  Maybe we need a couple of iterations.  I hope
> > you don't mind.
> 
> OK, with your modified cygwin1.dll in place I ran
> 
> strace -m all,paranoid -b 1000000 -o strace1.txt c:\cygwin-1.7\bin\bash.exe
> --login
> 
> and this time the error did occur.  Then I ran the strace again, and saved this
> 2nd output in strace2.txt.  As usual the error didn't occur the 2nd time, so  it
> may be useful to compare strace1 to strace2.
> 
> http://home.comcast.net/~aschulman2/cygwin-1.7/strace.tar.bz2

Thanks!

Something weird happens and the debug output is still insufficient
to show exactly *what* happens.  There is apparently some bug in
the function which loads /etc/passwd and /etc/group files.  The most
interesting output which differs between the straces is this:

Working (strace2):

 pwdgrp::load: \etc\passwd curr_lines 20308

Failing (strace1):

 pwdgrp::load: \etc\passwd curr_lines 520

So Cygwin thinks there are only 520 lines in the file, even though it
knows that the filesize is 2490367 bytes.

I have a vague idea what the culprit could be.  The only function which
could actually result in missing data is the call to NtReadFile.
Apparently it does not return the requested number of bytes, but only a
part of it.  The code does not explicitely test for this fact, it just
assumes that NtReadFile only returns after reading all requested bytes
or at EOF when reading a file.

Per MSDN, partial reads from a file shouldn't occur, but it's possible
that Cygwin is missing to set a precondition to get this behaviour
reliably.  Any problem to test again with another changed DLL I sent
to you?


Thanks very much for testing!


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019