This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin 1.7 domains and home directories


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]