From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id A6F3B3858405 for ; Sun, 28 Nov 2021 23:17:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A6F3B3858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id rNWlmRnKhztEjrTQTmDtD7; Sun, 28 Nov 2021 23:17:41 +0000 Received: from [192.168.1.105] ([68.147.0.90]) by cmsmtp with ESMTP id rTQSmUVj8d5UnrTQSmX6Aq; Sun, 28 Nov 2021 23:17:41 +0000 X-Authority-Analysis: v=2.4 cv=FrgWQknq c=1 sm=1 tr=0 ts=61a40e15 a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17 a=IkcTkHD0fZMA:10 a=jUpSR5ISAAAA:8 a=MU4eybcMYzc-gjLx57oA:9 a=QEXdDO2ut3YA:10 a=Tc1W4IvH-tAA:10 a=s8myQfwjxeVSfqcbdfSs:22 Message-ID: <565ef64a-b9ed-eca5-b473-cfe2a761559b@SystematicSw.ab.ca> Date: Sun, 28 Nov 2021 16:17:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Reply-To: cygwin@cygwin.com Subject: Re: zp_man-db-update-index.dash creates C:\cygwin64\%SystemDrive% Content-Language: en-CA To: cygwin@cygwin.com References: <645cbf8eca7d4451b1faa017d462235d@severstal.com> <4be058bb-5827-50bd-c65c-5e1c46ddc8b2@SystematicSw.ab.ca> <87y25d8lbo.fsf@Rainer.invalid> <87tug18h3i.fsf@Rainer.invalid> <87ee74oyqq.fsf@Rainer.invalid> From: Brian Inglis Organization: Systematic Software In-Reply-To: <87ee74oyqq.fsf@Rainer.invalid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfNnVIYnvnVmgkxqbClHu1uBcx9hTya54spttL0C/Di2yiogpTEIobvuchcutKKUdgg6jL4dFyo9xZLZ2RJYi//PXtxVH+YVAA6kWXpTC0U3BD6BQjgah 8jro4VA8zhRtCKRnzRJpLecWRwL6kh3uOwWz+/sdqdN22o/J80BR8Z0JRoxfyKXpO53uXX36HN6Gg7YQOPiByAcricYjLdV8VEI= X-Spam-Status: No, score=-1161.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2021 23:17:43 -0000 On 2021-11-25 11:51, Achim Gratz wrote: > Brian Inglis writes: >> On 2021-11-24 12:54, Achim Gratz wrote: >>> Brian Inglis writes: >>>> Problem mentioned by me some time ago, may be related to this, from >>>> undocumented mandb handling of Windows localization catalog folders: >> >>> It isn't, which could have easily been tested. >> >> Are you saying that the /%SystemDrive% issue is unrelated >> to mandb execution, contrary to the information from the OP? > > Yes, all the time, and now again. > >> How can it be tested, as I would like to do so, as I get those symptoms. > > mkdir -p /tmp/test/{s,p}d2 /tmp/test/{s,p}d3/sub > cd /tmp/test > env -i /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i SystemDrive=sd1 /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i ProgramData=pd1 /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i SystemDrive=sd2 /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i ProgramData=pd2 /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i SystemDrive=sd3/sub /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i ProgramData=pd3/sub /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i SystemDrive=sd3/nil /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i ProgramData=pd3/nil /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i SystemDrive=sd3/void/nil /usr/bin/cygstart --hide /usr/bin/dash -c echo > env -i ProgramData=pd3/void/nil /usr/bin/cygstart --hide /usr/bin/dash -c echo > ls -R > # cd ; rm -fr /tmp/test > > The behaviour with absolute paths is left as an exercise for the reader. What a mess! No sign of any obvious reports, except a decade old report of the same bug from C#: http://jeremymurray.org/doku.php/blog:20110804_directories_popping_up_named_systemdrive blaming the use of ShellExecute, which may have changed in cygutils cygstart, as the bug did not appear to occur until recently. Patching setup to pass those env vars through to scripts would be one approach. Patching cygstart to set those env vars if unset, using CSIDLs/KNOWNFOLDERIDs like cygpath -F is another. >> I found that when setup is executed, as the PATH sanitized for scripts >> includes cygpath -S, mandb appears to search directories in the >> Windows PATH, for cat... directories, may remove the contents, even >> when they are not manual pages, and may perform other poorly or >> undocumented operations. > > Again, in no variant of trying to reproduce this was I ever successful > in seeing that happen. So either this problem is no longer occuring or > there is some extra condition for it to trigger. > >> It appears that mandb climbs the tree trying to find related bin and >> man dirs. > > There's no code in mandb that obviously does this, so you'll have to > provide some evidence of when and where it happens. And it should > already show up in the output of 'manpath -dc' I think, since I've only > ever seen mandb removing something that is in catdirs. So for instance > if I drop bogus directories cat9 and de_AT into /var/cache/man (which > don't have a corresponding manpath obviously), I'll see: > > --8<---------------cut here---------------start------------->8--- > Removing obsolete cat directory /var/cache/man/cat9... > Seen mandir for /var/cache/man/ca; not deleting > Seen mandir for /var/cache/man/cs; not deleting > Seen mandir for /var/cache/man/da; not deleting > Seen mandir for /var/cache/man/da.ISO8859-1; not deleting > Seen mandir for /var/cache/man/da.UTF-8; not deleting > Seen mandir for /var/cache/man/de; not deleting > Seen mandir for /var/cache/man/de.ISO8859-1; not deleting > Seen mandir for /var/cache/man/de.UTF-8; not deleting > Removing obsolete cat directory /var/cache/man/de_AT... > --8<---------------cut here---------------end--------------->8--- > > Which is correct since /var/cache/man is the only catdir on my system. > If I drop these anywhere else in any of the directory in PATH mandb will > not touch them (in fact it never bothers to look there). > >> It may be having shared man and "stray" cat dirs for other Windows >> package commands, cmd, Windows utilities, and systems (-m) under >> /proc/cygdrive/c/usr/local/. >> I don't know any other way I could keep the system level shared >> contents accessible while isolating it. > > Again, if that's the problem I have not been able to reproduce it. I'll create a new 0p_man-db-patch.dash script to add -d after mandb postinstall to produce diagnostic output, and get back. I previously had a patch script to add around mandb in postinstall: /usr/bin/nohup ... /usr/bin/mandb ... & which did not create any artifacts I believe but can not be sure of timing, and that could be an option for your script instead of cygstart? -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]