delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/02/06/10:33:05

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:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=yZ
gHRprVpvDZCfyJ20+JNa4h7WrbMgOII2RHwvJKEXifs+CRb4jgVSfIMnSQFJahcC
QvsxifBmyuNAaDi2jdIBPx2Sk8qzs4YnXbha2BRlJaSqf89FHPadrOWLtRAAWaV5
O9rgrzU+t+7qNtY+ldG7jGghBZ9qNmQEXXvNXB+/g=
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:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=u0vOI2Zn
A8C8EOf/KNUX4qme2D0=; b=Lezkzh+U7I4A/neo5CBEZdYWYhIu1Q6n6tjTuefE
eiTn7WfmVk1AfHj3yzs/jxr50KuvfhAxenUvOcDflqmEIIqCJHBcCrONaoFhubPf
HdFT884P8gtTy1CuKgwMAPyMMdwZr41AbiWBYp8u4Ab/PgAyC7wb0iCyYa9iwfgK
OJ8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=1.9 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,TBC autolearn=no version=3.3.2
X-HELO: mail-la0-f51.google.com
MIME-Version: 1.0
X-Received: by 10.152.242.165 with SMTP id wr5mr1874984lac.47.1391700748986; Thu, 06 Feb 2014 07:32:28 -0800 (PST)
In-Reply-To: <1811171498.20140206155616@mtu-net.ru>
References: <CAM9pMnM1=UnbcXRGefXiDVjVXJcVeNej=OGowbwwWBgHeG+MjQ AT mail DOT gmail DOT com> <CAEhDDbCG7i9GdEE1W2UL9egRdcA786u0xmwsKJXBD5HgXh5XcA AT mail DOT gmail DOT com> <CAM9pMnM-_hZkk5+=44aTKrscqYP-qg1Mv=R4w7Jt2gFjd_WP8w AT mail DOT gmail DOT com> <1811171498 DOT 20140206155616 AT mtu-net DOT ru>
Date: Thu, 6 Feb 2014 16:32:28 +0100
Message-ID: <CAM9pMnMBpULHt7NTx-eOr8DmLkQFTQwtTmMpDmbA8UQqLpUh7g@mail.gmail.com>
Subject: Re: $PATH contains dot but unclear where it comes from
From: Robert Klemme <shortcutter AT googlemail DOT com>
To: Andrey Repin <cygwin AT cygwin DOT com>
X-IsSubscribed: yes

On Thu, Feb 6, 2014 at 12:56 PM, Andrey Repin wrote:
> Greetings, Robert Klemme!

Hello Andrey!

>> I should have mentioned that I did just that - to no avail.
>
>> $ echo exit | bash --login -i -x 2>|log
>> $ egrep -n 'PATH=(.:|.*:\.($|:))' log | head
>> 1:+ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.
>> 140:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 145:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 152:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 159:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 166:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 171:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 178:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 183:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>> 190:+++ PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.:/sbin:/usr/sbin:/usr/local/sbin
>
>> Also manual inspection does not show any line where the dot is
>> introduced.  The first line with an assignment to PATH which contains
>> the dot in the trace output is this one in /etc/profile:
>
>> PATH="/usr/local/bin:/usr/bin:${PATH}"
>
>> In the trace (see above):
>
>> + PATH=/usr/local/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.
>
>> As you can see the dot is already there.  It seems it appears
>> somewhere in the mintty launching process.
>
> This seems much like you have an imposter somewhere in your system.
> Please start cmd.exe alone, and do the following in order:

Good idea to do it in cmd.exe!

> echo %PATH% > "%USERPROFILE%/bash-startup.log"
> bash --login -x 2>&1 | tee -a "%USERPROFILE%/bash-startup.log"

Why use tee here?  I did this:

C:\Users\rklemme>path >log

C:\Users\rklemme>echo exit | c:\cygwin64\bin\bash.exe --login -x -i >>log 2>&1

> Then check the logfile for issues.

Same story.  These are the first lines of the log

$ head -10 log | cut -c 1-80
PATH=C:\PROGRAM FILES (X86)\NVIDIA CORPORATION\PHYSX\COMMON;C:\PROGRAM FILES (X8
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
+ PATH='/usr/local/bin:/usr/bin:/cygdrive/c/PROGRAM FILES (X86)/NVIDIA CORPORATI
+ MANPATH=/usr/local/man:/usr/share/man:/usr/man:
+ INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
++ id -un
+ USER=rklemme
+ ORIGINAL_TMP=/cygdrive/c/Users/rklemme/AppData/Local/Temp
+ ORIGINAL_TEMP=/cygdrive/c/Users/rklemme/AppData/Local/Temp

The first line does not contain the dot.  The fourth line contains the
dot at the end:

$ sed -nre '4s#^(.{20}).*(.{80})$#\1...\2#p' log
+ PATH='/usr/local/b...Intel/WirelessCommon:/cygdrive/c/Users/rklemme/Applications/SysinternalsSuite:.'

Concluding from the context (following lines) this is, as written
before, this line from /etc/profile:

PATH="/usr/local/bin:/usr/bin:${PATH}"
MANPATH="/usr/local/man:/usr/share/man:/usr/man:${MANPATH}"
INFOPATH="/usr/local/info:/usr/share/info:/usr/info:${INFOPATH}"

There is clearly no dot there. It's a mystery.

Wait, I tested with strace:

C:\Users\rklemme>echo exit | c:\cygwin64\bin\strace.exe -f /bin/bash
--login -x -i >str 2>&1

I found
...
   36    6393 [main] bash 8028 getwinenv: can't set native for PATH=
since no environ yet
...
   12    7518 [main] bash 8028 mount_info::conv_to_posix_path:
conv_to_posix_path (C:\Users\rklemme\Applications\SysinternalsSuite,
keep-rel, no-add-slash)
   12    7530 [main] bash 8028 normalize_win32_path:
C:\Users\rklemme\Applications\SysinternalsSuite = normalize_win32_path
(C:\Users\rklemme\Applications\SysinternalsSuite)
   14    7544 [main] bash 8028 mount_info::conv_to_posix_path:
/cygdrive/c/Users/rklemme/Applications/SysinternalsSuite =
conv_to_posix_path (C:\Users\rklemme\Applications\SysinternalsSuite)
   14    7558 [main] bash 8028 mount_info::conv_to_posix_path:
conv_to_posix_path (., keep-rel, no-add-slash)
   12    7570 [main] bash 8028 mount_info::conv_to_posix_path: . =
conv_to_posix_path (.)
   12    7582 [main] bash 8028 __set_errno: ssize_t
env_PATH_to_posix(const void*, void*, size_t):3570 setting errno 36
...
   12   12308 [main] bash 8028 mount_info::conv_to_win32_path:
src_path /cygdrive/c/Users/rklemme/Applications/SysinternalsSuite, dst
C:\Users\rklemme\Applications\SysinternalsSuite, flags 0x4022, rc 0
   35   12343 [main] bash 8028 symlink_info::check: 0x0 = NtCreateFile
(\??\C:\Users\rklemme\Applications\SysinternalsSuite)
   18   12361 [main] bash 8028 symlink_info::check: not a symlink
   21   12382 [main] bash 8028 symlink_info::check: 0 =
symlink.check(C:\Users\rklemme\Applications\SysinternalsSuite,
0x228DC0) (0x804022)
   13   12395 [main] bash 8028 path_conv::check:
this->path(C:\Users\rklemme\Applications\SysinternalsSuite),
has_acls(1)
   14   12409 [main] bash 8028 normalize_posix_path: src .
   11   12420 [main] bash 8028 cwdstuff::get: posix /cygdrive/c/Users/rklemme
   12   12432 [main] bash 8028 cwdstuff::get:
(/cygdrive/c/Users/rklemme) = cwdstuff::get (0x600000010, 32768, 1,
0), errno 36
   13   12445 [main] bash 8028 normalize_posix_path:
/cygdrive/c/Users/rklemme/ = normalize_posix_path (.)
   11   12456 [main] bash 8028 mount_info::conv_to_win32_path:
conv_to_win32_path (/cygdrive/c/Users/rklemme)
   12   12468 [main] bash 8028 mount_info::cygdrive_win32_path: src
'/cygdrive/c/Users/rklemme', dst 'C:\Users\rklemme'
   12   12480 [main] bash 8028 set_flags: flags: binary (0x2)
   11   12491 [main] bash 8028 mount_info::conv_to_win32_path:
src_path /cygdrive/c/Users/rklemme, dst C:\Users\rklemme, flags
0x4022, rc 0
   33   12524 [main] bash 8028 symlink_info::check: 0x0 = NtCreateFile
(\??\C:\Users\rklemme)
   17   12541 [main] bash 8028 symlink_info::check: not a symlink
   20   12561 [main] bash 8028 symlink_info::check: 0 =
symlink.check(C:\Users\rklemme, 0x228DC0) (0x804022)
   13   12574 [main] bash 8028 path_conv::check:
this->path(C:\Users\rklemme), has_acls(1)
   33   12607 [main] bash 8028 cwdstuff::get: posix /cygdrive/c/Users/rklemme
   12   12619 [main] bash 8028 cwdstuff::get: (C:\Users\rklemme) =
cwdstuff::get (0x600058F70, 32768, 0, 0), errno 36
   35   12654 [main] bash 8028 win_env::add_cache: posix
/cygdrive/c/PROGRAM FILES
(X86)/NVIDIA...Common:/cygdrive/c/Users/rklemme/Applications/SysinternalsSuite:.
   22   12676 [main] bash 8028 win_env::add_cache: native
PATH=C:\PROGRAM FILES
(X86)\NVIDIA...Common;C:\Users\rklemme\Applications\SysinternalsSuite;.
   39   12715 [main] bash 8028 posify_maybe: env var converted to
PATH=/cygdrive/c/PROGRAM FILES
(X86)/NVIDIA...lessCommon:/cygdrive/c/Users/rklemme/Applications/SysinternalsSuite:.
   41   12756 [main] bash 8028 environ_init: 0x600069CD0:
PATH=/cygdrive/c/PROGRAM FILES
(X86)/NVIDIA...elessCommon:/cygdrive/c/Users/rklemme/Applications/SysinternalsSuite:.

(Few items replaced by "..." to avoid extremely long lines.)

Can anybody make sense of that?  I can share the complete log with
individuals if it helps.

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019