Skip to content

Increase stack size for PowerShell 5 #1797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2022

Conversation

nohwnd
Copy link
Contributor

@nohwnd nohwnd commented May 11, 2022

Sets the Thread max stack size to use the same value that is normally used in console host. This gives PowerShell code more room for execution, so recursive calls, or calls that are wrapped in Pester (which itself is stack-hungry), won't fail with:

System.Management.Automation.ScriptCallDepthException: The script failed due to call depth overflow.

Fix PowerShell/vscode-powershell#3962

@nohwnd nohwnd requested a review from a team May 11, 2022 10:43
@nohwnd nohwnd closed this May 11, 2022
@nohwnd nohwnd reopened this May 11, 2022
@nohwnd
Copy link
Contributor Author

nohwnd commented May 11, 2022

One of the builds seems to fail due to flakiness.

@nohwnd
Copy link
Contributor Author

nohwnd commented May 11, 2022

Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, nice fix. Thank you!

@andyleejordan andyleejordan changed the title Increase stack size for PS5 Increase stack size for PowerShell 5 May 11, 2022
@andyleejordan andyleejordan merged commit dfd63aa into PowerShell:master May 11, 2022
@markdowd
Copy link

Any idea when the new version will appear in PSGallery? Currently showing as Version 5.3.3, which has the problem.

@andyleejordan
Copy link
Member

Ah, sorry, we thought we had two PRs that would get in sooner than they did. It'll be out this week! Though we don't update the PSGallery, you'll find the PSES versions at https://github.com/PowerShell/PowerShellEditorServices/releases and the extension at https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell with the preview available at https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell-Preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ScriptCallDepthException thrown during Pester-tests only in PS5.1 Integrated Console
3 participants