PowerShell / PowerShell/vscode-powershell

[macOS and Linux] PSES crashes - System.IO.IOException: Too many open files

Open
#1,017 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Symbols & References Area-Workspaces Issue-Bug OS-Linux OS-macOS
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

System Details
  • Operating system name and version:
    • macOS 10.12.6
    • Ubuntu 16.0
  • VS Code version: 1.15.1
  • PowerShell extension version: 1.14.1
  • Output from $PSVersionTable (on macOS):
Name                           Value                                                                                                                                               
----                           -----                                                                                                                                               
PSVersion                      6.0.0-beta                                                                                                                                          
PSEdition                      Core                                                                                                                                                
GitCommitId                    v6.0.0-beta.6                                                                                                                                       
OS                             Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64                                      
Platform                       Unix                                                                                                                                                
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                             
PSRemotingProtocolVersion      2.3                                                                                                                                                 
SerializationVersion           1.1.0.1                                                                                                                                             
WSManStackVersion              3.0                                                                                                                                                 

From macOS:

PS> code -v
1.15.1
41abd21afdf7424c89319ee7cb0445cc6f376959
PS> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0


PS> code --list-extensions --show-versions
Shan.code-settings-sync@2.8.3
donjayamanne.python@0.7.0
fabianlauer.vs-code-xml-format@0.1.5
florianloch.text-transform@0.1.0
idleberg.applescript@0.6.1
ms-vscode.cpptools@0.12.3
ms-vscode.csharp@1.12.1
ms-vscode.PowerShell@1.4.1
slevesque.vscode-hexdump@1.4.0
PS> $PSVersionTable
Issue Description

Things start to go wrong when the PS version cannot be determined and the version is assumed to be v5:

[WARNING] - Method "GetVersionDetails" at line 153 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellVersionDetails.cs

  Failed to look up PowerShell version, defaulting to version 5.

In effect, the Editor Services don't work properly on either platform, but some aspects still work on Linux, such as F8.

On macOS, the logs show additional failures:

System.AggregateException: One or more errors occurred. (Too many open files) ---> System.IO.IOException: Too many open files
...
PowerShell Editor Services is terminating due to an unhandled exception

Note that ulimit -n (number of files that can be open simultaneously) still defaults to 256 as of macOS 10.12.6.

Attached Logs

macOs.zip

ubuntu.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PowerShellEditorServices/Session/PowerShellVersionDetails.cs, especially GetVersionDetails around line 153, then review the attached macOS and Ubuntu logs. Reproduce the version-detection failure and the macOS "Too many open files" condition with the reported ulimit; done means Editor Services no longer terminates and the affected functionality works on both platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.