Skip to content

Tab completion under /mnt/c stymied by hiberfil.sys #7648

Closed

Description

Steps to reproduce

Running Ubuntu 16.04.4 LTS (via WSL):

$error.Clear()
Import-Module /mnt/c/[tab][tab][tab][tab][tab][tab][tab]
#then clear the command line and run
$error

Expected behavior

No problems, you just get tab completion for stuff under your C drive.

Actual behavior

You don't get any tab completion. For as many times as you hit [tab], you have an error like this in $error:

Exception calling "CompleteInput" with "3" argument(s): "Access to the path '/mnt/c/hiberfil.sys' is denied."
At line:38 char:16
+ ...      return [System.Management.Automation.CommandCompletion]::Complet ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : UnauthorizedAccessException

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0-rc.1
PSEdition                      Core
GitCommitId                    6.1.0-rc.1
OS                             Linux 4.4.0-17738-Microsoft #1000-Microsoft Fri Aug 10 17:06:00 PST 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. iSazonov commented on Aug 31, 2018

    @iSazonov
    Collaborator

    Does dir /mnt/c/ work well and show the file and its properties? For Pagefile.sys?

  2. jazzdelightsme commented on Sep 2, 2018

    @jazzdelightsme
    ContributorAuthor

    No; enumeration is halted (with an error) when it gets to hiberfil.sys:

    PS /home/dt29> dir /mnt/c/
    
    
        Directory: /mnt/c
    
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----         10/24/17   5:11 PM                $Recycle.Bin
    d-----          8/16/18   6:55 PM                Apps
    d-----          5/16/18   4:34 PM                Debuggers
    d-----         10/27/17   8:53 AM                DRIVERS
    d-----          1/19/18   8:48 PM                Dumps
    d-----          7/29/18  11:19 PM                Intel
    d-----          8/30/18   5:33 PM                Microsoft
    d-----          7/12/18   8:24 PM                MSOCache
    d-----          4/11/18   1:00 PM                MSOTraceLite
    d-----          8/30/18   7:51 PM                OneDriveTemp
    d-----          8/19/18   3:55 AM                PerfLogs
    d-r---          8/30/18   6:41 PM                Program Files
    d-r---          8/31/18   5:22 PM                Program Files (x86)
    d-----          8/31/18   4:49 PM                ProgramData
    d-----          8/30/18   7:39 PM                Recovery
    d-----           2/4/18   7:18 PM                scratch
    d-----          8/31/18   5:00 PM                src
    d-----           8/9/18   2:12 PM                symcache
    d-----           9/1/18   1:10 PM                System Volume Information
    d-----          8/31/18   5:26 PM                temp
    d-----          8/29/18   5:59 PM                tools
    d-r---          8/30/18   6:41 PM                Users
    d-----           9/1/18   8:06 PM                vim
    d-r---           9/1/18  12:48 PM                Windows
    d-----          8/30/18   6:47 PM                Windows.old
    d-----          4/26/18   8:31 PM                WU_logs
    dir : Access to the path '/mnt/c/hiberfil.sys' is denied.
    At line:1 char:1
    + dir /mnt/c/
    + ~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (/mnt/c/:String) [Get-ChildItem], UnauthorizedAccessException
    + FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
    
    
    
    PS /home/dt29>
    
  3. DHowett commented on Sep 6, 2018

    @DHowett

    The ability to see the attributes for hiberfil.sys should be gated on the traversal and read attributes on its parent folder.

    That it is not suggests that powershell is opening files as it enumerates them.

    Why is powershell doing that? Is that the actual bug here?

  4. iSazonov commented on Sep 7, 2018

    @iSazonov
    Collaborator

    The files (pagefile.sys, hiberfil.sys, swapfile.sys) is locked by system and CoreFX can not read attributes of the files. We already get a CoreFX fix for Windows but it turned out that Unix code is also subject to this problem. It is my understanding the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions