Cygwin 1.7 domains and home directories

Corinna Vinschen
Fri Dec 19 15:28:00 GMT 2008

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


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 Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list