Skip to content

os/exec: LookPath inconsistency on windows/arm64 #44379

@rsc

Description

@rsc

After a recent Windows 10 update on my Surface Pro X, os/exec TestLookPath is failing.
It appears to be a bug introduced in the update in cmd.exe itself.

The transcript below seems to show that cmd.exe is not respecting the order of extensions in PATHEXT:
even though EXE comes before BAT, cmd is prefering a.bat over a.exe.

C:\Users\russc\tmp>dir
 Volume in drive C is Local Disk
 Volume Serial Number is 6254-048B

 Directory of C:\Users\russc\tmp

02/18/2021  08:13 AM    <DIR>          .
02/18/2021  08:10 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  420,601,499,648 bytes free

C:\Users\russc\tmp>mkdir p1

C:\Users\russc\tmp>copy con p1\a.bat
@echo a1.bat
^Z
        1 file(s) copied.

C:\Users\russc\tmp>copy ..\go\bin\go.exe p1\a.exe
        1 file(s) copied.

C:\Users\russc\tmp>p1\a.exe
Go is a tool for managing Go source code.
...

C:\Users\russc\tmp>p1\a.bat
a1.bat

C:\Users\russc\tmp>p1\a
a1.bat

C:\Users\russc\tmp>set PATHEXT
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

C:\Users\russc\tmp>p1\a.BAT
a1.bat

C:\Users\russc\tmp>p1\a.EXE
Go is a tool for managing Go source code.
...

C:\Users\russc\tmp>set PATH=C:\users\russc\tmp\p1

C:\Users\russc\tmp>a
a1.bat

C:\Users\russc\tmp>

Edit: I am running Windows 10 Home Insider Preview, Build 21301.rs_prerelease.210123-1645, on a Surface Pro X.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions