This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 3.0.7(0.338/5/3): Possible reference to Developer's instances of dev files in deployed build
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Sat, 7 Dec 2019 21:03:23 +0000
- Subject: Re: 3.0.7(0.338/5/3): Possible reference to Developer's instances of dev files in deployed build
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JbApFVKzLxvWvQz4wxQXz0qmKduQ0RCHPU/6PmMEn/k=; b=l7dtlZIVQi6n2a08+YUJq0+8hOQpkPUpApWmz/gIC98idb4f1f6xno+9nMHsv9TDgVZ2qP0zixYBNCDIs8f48gHZb+oeqOEuLW4cqaeYD3GCTm+eYalM7AG3iu0jxQyrp9kGLnIpfELU+vfS5G1XspHcNYjhX1wPA0sG30Xcg2KzD1q/TuMaOUp0LiPVsXWJqBZaJSwGduXPXonmRiVrMS1lBv0s+L1MHP4T1fB7b3AFwkRrMAVttRpprfIbfE1pYrdc0t9/kUzh+sbCkbo0BozafFGBspeJp+4426GeoB1eSG54kjkhreJtx8MNz8p4gQef//3KXB3nV90+Y69WLQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f0PfgBQqhsTRgD8Pa0NGZHgLpl31wOLYK8Am9veCNxyWzW4rQjpfPhgIyt5bYQLhVf6rc4ssQLhv+hfTfp+mNK5moig3eIiZzc3wVtw1x6LzGC+6dVzKPbLUtI76RnNDMdBZCgmmdLRcxZqSvV8+xvyagVKNxP1EWxtnlOk8sAtfwKJAk9hOzPyYV5tr10S28ItOubFwn4fLo1fQ2uRO9eAB0p4fueqzf5FzGd+jQgfLbIgihn5RB8VC79OFBhYOkvKPw9HK0ar8+WtLacgl22Gy3vBraurckq/TOntkJ3By4xUO+VqkuA10q/qw+0i2f57k0F1mhQoRcAyILSotfQ==
- References: <20191206045537.GA22631@shackleton.labs.net> <20191206110709.GB3499@calimero.vinschen.de> <20191206143457.GC3499@calimero.vinschen.de>
On 12/6/2019 9:34 AM, Corinna Vinschen wrote:
> On Dec 6 12:07, Corinna Vinschen wrote:
>> Right. Cygwin uses a simple mechanism to check the drives to show
>> under /cygdrive. Basically it just calls the Win32 function
>> GetLogicalDriveStrings(), then, for each drive, it checks the
>> QueryDosDevice mapping. Right now it only accepts cdrom, floppy,
>> harddrive, LanmanRedirector (SMB) and MRxNfs (NFS). All other
>> drive types are treated as "no disk". This is fixable with probably not
>> too much effort.
>
> Ah, yes, there's a problem. When listing /cygdrive, we're trying to do
> this as quick as possible. For network drives, we check if they are
> available using a function NetUseGetInfo, which only takes a few ms,
> even if the drive is unavailable.
>
> As soon as this function returns the state "disconnected", Cygwin
> skips the drive in /cygdrive.
>
> However, this function does not know anything about client side caching
> (CSC). To find out if the drive is available via CSC, the drive
> has to be opened and checked for filesystem information, which reflects
> the state that the filesystem is still available offline.
>
> The problem with this approach is, it would have to be called for
> each unavailable drive in /cygdrive. This takes multiple secs per
> drive. That's exacly what we tried to avoid when calling the
> aforementioned NetUseGetInfo function in the first place.
>
> Checking for a CSC-ed drive when disconnected would make /cygdrive
> listing very slow, just as in the old days...
I don't have any words of wisdom here, but I need to correct something I said
earlier.
On 12/4/2019 3:50 PM, Ken Brown wrote:
> I don't have time to check this carefully at the moment, but it looks like
> what's happening is the following:
>
> path_conv::check is called on 'Z:\'. It strips the trailing backslash and calls
> mount_info::conv_to_win32_path on 'Z:'. NtCreateFile fails with
> STATUS_OBJECT_NAME_NOT_FOUND, which triggers the code containing the assertion.
> The assertion fails because 'Z:' doesn't contain a backslash.
This is not quite right. It's true that path_conv::check strips the trailing
backslash from Z:\, but then it adds it back before calling symlink_info::check:
/* If path is only a drivename, Windows interprets it as the
current working directory on this drive instead of the root
dir which is what we want. So we need the trailing backslash
in this case. */
if (full_path[0] && full_path[1] == ':' && full_path[2] == '\0')
{
full_path[2] = '\\';
full_path[3] = '\0';
}
Thus symlink_info::check is in fact called on Z:\, but the assertion fails
because the code at path.cc:2905 is looking for a backslash prior to the
trailing backslash. So maybe the right fix for the assertion failure is the
following:
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2895,7 +2895,8 @@ restart:
slow down normal operation. This extra check only kicks in if
we encountered a STATUS_OBJECT_NAME_NOT_FOUND *and* we didn't
already attach a suffix. */
- if (!restarted && !*ext_here && !(mount_flags & MOUNT_DOS))
+ if (!restarted && !*ext_here && ext_here[-1] != '\\'
+ && !(mount_flags & MOUNT_DOS))
{
/* Check for trailing dot or space or leading space in
last component. */
Ken
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple