X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; q=dns; s=default; b=apc2IVOA2EF7fl22oBO4qAdmuL5Yl mLzQ8yOEM/Fh2ML+OcIpujZP2WxeLWggAY+WQ7fi2epkUOoOciW3MZZmstJPj4/q 0o2xB8gkAI6Y83/OoNhpd1HfF9ex1sH1wxYB6/MF3RO3Q7eCzyV+Dua2rN7DPH2F e6LmCx6Rn8jz6E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; s=default; bh=u+qzVXFYXN5kUbMguz0xHWSMCaU=; b=MIh FX4RdYhgO369AH1/GMDSBkBVwTk+6TVqSjnHo8KWAtpDjlikyaIy/yp6TBTp7m22 nCRjPJELlp/1SkyYuUDViry03kU71TgqvZ6aCqJL8e6ook7MFKLOcpsIc/e195dC ESwLPV5itloCUFPRSdcSsdWuSusCMFYRRZtQnbSk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=wisdom, H*M:edu, HX-Spam-Relays-External:15.20.2516.13, H*r:15.20.2516.13 X-HELO: NAM02-CY1-obe.outbound.protection.outlook.com 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== 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-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JbApFVKzLxvWvQz4wxQXz0qmKduQ0RCHPU/6PmMEn/k=; b=G776zerpTwMx6XLN83BbbROrvj8K6ImHs9LuR+uWeP2zAWaRjLmdikaaTNO+UQBZt92hnnM+Tdt/qsI9g9ZxvHcfE9QVC1xT93UwDj3iEJ8HSlLRz0rlcbtBUA5JThADlEERdwW1sEC4mtUxRbcXu9QnWyZ3O0Vjjppqzz0FHko= From: Ken Brown To: "cygwin AT cygwin DOT com" Subject: Re: 3.0.7(0.338/5/3): Possible reference to Developer's instances of dev files in deployed build Date: Sat, 7 Dec 2019 21:03:23 +0000 Message-ID: References: <20191206045537 DOT GA22631 AT shackleton DOT labs DOT net> <20191206110709 DOT GB3499 AT calimero DOT vinschen DOT de> <20191206143457 DOT GC3499 AT calimero DOT vinschen DOT de> In-Reply-To: <20191206143457.GC3499@calimero.vinschen.de> user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu; x-ms-oob-tlc-oobclassifiers: OLM:8882; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-ID: <681390F886556945BB86288238698259 AT namprd04 DOT prod DOT outlook DOT com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: krNtoqr8ofeHVm1JVgIq8e3mkHiirih9eLpsEnEkLEQSThvIc05XnBeZTEzuH0XyMedPRN+rNFSCQaCjJe+1Ww== X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id xB7L4098012163 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