Skip to content

InsufficientExecutionStackException: 5.2.2 looping over psremote session #1974

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

Closed
rismoney opened this issue Jun 5, 2021 · 17 comments
Closed

Comments

@rismoney
Copy link
Contributor

rismoney commented Jun 5, 2021

Using 5.2.2 and running pester tests over a pssession.

I think this could be related to #822

If you run pester multiple times in a pssession, particular with describe -foreach exhausts the stack fairly easily.

I am basically iterating over an array that has 15 elements, with the elements being 1 level deep hashs:

beforediscovery {
$apps = @(@{arp_name="n/a";Name="na";version="4.8.3928.00"},
    @{arp_name="app1";Name="app1";version="7.24.1000.10"},
    @{arp_name="app3";Name="3";version="5.2.20190922"},
etc
)
}

Then I do a

Describe "Packaging" -Tag "PLB" {
	
	BeforeAll {
  $paths = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
  $allapps=@()
  $allapps=(Get-ItemProperty $paths -Name displayname -ea SilentlyContinue)
	}




  Describe "Package Status" -ForEach $apps -Tag "PLB" {
    BeforeEach {
      $appInstalled=$null
      $chocoInstalled=$null
    }
    
    If ($arp_name -ne "n/a") {
      It "$($Name) should be installed " {
        if ($allapps.Displayname.Contains($arp_name)) {$appInstalled=$true} else {$appInstalled=$false}
          $appInstalled | Should -Be $true
      }
    }
  }
  
}
}

If I run this multiple times, it may work the 1st time, but definitely not subsequent. In fact the whole session falls apart.

Error message:

InsufficientExecutionStackException: Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.

@nohwnd
Copy link
Member

nohwnd commented Jun 5, 2021

Hmm interesting. Have you tried the code I posted there to print the size of available stack? Is the number different on first run and on second run?

@rismoney
Copy link
Contributor Author

rismoney commented Jun 5, 2021

it is 230 before and after.
Win2016, PSVersion 5.1.19041.906

updating above issue with code.

@rismoney
Copy link
Contributor Author

rismoney commented Jun 5, 2021

so if i add more items to $apps - it will fail sooner. Hardly a large dataset (array of 20 items with a hash of 3 k/v pairs)

@rismoney
Copy link
Contributor Author

rismoney commented Jun 5, 2021

Final note- no errors/issues running interactively on the host, only remote.

@rismoney
Copy link
Contributor Author

rismoney commented Jun 5, 2021

Not sure if this helps:

I added a breakpoint inside the It. and ran it 3 times to force the issue.

[myserver]: [DBG]: PS C:\@inf\winbuild\acceptance>> Invoke-Pester -Tags PLB -Output Detailed .\HostHealth.Tests.ps1

Starting discovery in 1 files.
Filter 'Tag' set to ('PLB').
Discovering in C:\@inf\winbuild\acceptance\HostHealth.Tests.ps1.
[-] Discovery in C:\@inf\winbuild\acceptance\HostHealth.Tests.ps1 failed with:
Invoking step ContainerDiscoveryEnd failed:
Result :Error :Write-ErrorToScreen :
at <ScriptBlock>, C:\@inf\winbuild\acceptance\HostHealth.Tests.ps1: line 257
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2097
at Invoke-TestItem, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1172
at Invoke-Block, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 823
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1649
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.ps1: line 3
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 3126
at Invoke-InNewScriptScope, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 3133
at Run-Test, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1652
at Invoke-Test, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2441
at Invoke-Pester<End>, C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1: line 5089

The script failed due to call depth overflow.
At C:\Program Files\WindowsPowerShell\Modules\Pester\5.2.2\Pester.psm1:5219 char:13
+             Write-ErrorToScreen $_ -Throw:$PesterPreference.Run.Throw ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (0:Int32) [], RuntimeException
    + FullyQualifiedErrorId : CallDepthOverflow

[myserver]: [DBG]: PS C:\@inf\winbuild\acceptance>>

@rismoney
Copy link
Contributor Author

rismoney commented Jun 5, 2021

At C:\@inf\winbuild\acceptance\HostHealth.Tests.ps1:257 char:13
+         if ($allapps.Displayname.Contains($arp_name)) {$appInstalled= ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[nycowdplb-p314]: [DBG]: PS C:\@inf\winbuild\acceptance>> s
[-] Describe Packaging.Package Status failed
   ScriptCallDepthException: The script failed due to call depth overflow.
   RuntimeException: The script failed due to call depth overflow.

@rismoney
Copy link
Contributor Author

rismoney commented Jun 6, 2021

I seem to have worked around this issue. Instead of using get-childitem or Get-ItemProperty or other powershell cmds, I am now using dotnet calls, against $HKLM = [microsoft.win32.registrykey]::OpenBaseKey('LocalMachine',"Default")

For reasons that are not clear to me, this may be related to PowerShell/PowerShell#5536

@rismoney
Copy link
Contributor Author

rismoney commented Jun 6, 2021

it's possible that is a red herring now - i think it may be related to nested describe {} stanzas... will test more.

@JustinGrote
Copy link
Contributor

JustinGrote commented Aug 22, 2021

@nohwnd I'm running into a similar problem when running tests within a WinPS5.1 Job from PS7, it doesn't happen anywhere else, and I know it's not my script because if I reorder the test files, the stacktrace fails in a different place.

Starting discovery in 5 files.
Discovery finished in 545ms.
Running tests.
[+] Register-KeePassSecretVault.Tests.ps1 5.93s (5.05s|659ms)
WARNING: [08:27:45][Get-Secret] Multiple ambiguous entries found for double entry, please remove the duplicate entry or specify the full path of the secret
WARNING: [08:27:45][Get-Secret] Multiple ambiguous entries found for double entry, please remove the duplicate entry or specify the full path of the secret
WARNING: [08:27:46][Get-Secret] Multiple ambiguous entries found for double entry, please remove the duplicate entry or specify the full path of the secret
[+] Get-Secret.Tests.ps1 2.19s (1.57s|549ms)
WARNING: [08:27:47][VaultError] Vault KeepassPesterTest_e7eae3a7-1425-4a3c-8db7-a5cb3cbb0f31: No Keepass Entry named PesterTestSecret found
WARNING: [08:27:47][VaultError] Vault KeepassPesterTest_cf564987-445e-45ac-870b-0d17b3ce0932: There are multiple entries with the name Double Entry and Remove-Secret will not proceed for safety.
[+] Remove-Secret.Tests.ps1 1.4s (1.26s|108ms)

[-] Context Test-SecretVault.Function Parameter Validation failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with correct MasterPassword failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with incorrect MasterPassword failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with Path and correct UseMasterPassword failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with path and incorrect MasterPassword failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with correct Keyfile failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with incorrect Keyfile failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with correct Keyfile v2 failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with correct Keyfile and correct master password failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with correct Keyfile and incorrect master password failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

[-] Context Test-SecretVault.Validating with incorrect Keyfile and correct master password failed
 ScriptCallDepthException: The script failed due to call depth overflow.
 RuntimeException: The script failed due to call depth overflow.

Stacktrace in WinPS 5.1 Job right before callstackoverflow (Get-PSCallStack)

at <ScriptBlock>, C:\Users\JGrote\Projects\SecretManagement.KeePass\SecretManagement.KeePass\SecretManagement.KeePass.Extension\Public\Test-SecretVault.Tests.ps1: line 41
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2097
at Invoke-TestItem, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1172
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 823
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1649
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.ps1: line 3
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 3126
at Invoke-InNewScriptScope, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 3133
at Run-Test, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1652
at Invoke-Test, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2441
at Invoke-Pester<End>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 5089
at <ScriptBlock>, <No file>: line 11

Stacktrace in PS7 job (works fine)

at <ScriptBlock>, C:\Users\JGrote\Projects\SecretManagement.KeePass\SecretManagement.KeePass\SecretManagement.KeePass.Extension\Public\Test-SecretVault.Tests.ps1: line 41
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2097
at Invoke-TestItem, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1172
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 823
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 878
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1975
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1936
at Invoke-ScriptBlock, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2100
at Invoke-Block, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 923
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1649
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.ps1: line 3
at <ScriptBlock>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 3126
at Invoke-InNewScriptScope, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 3133
at Run-Test, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 1652
at Invoke-Test, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 2441
at Invoke-Pester<End>, C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1: line 5089
at <ScriptBlock>, <No file>: line 11

@JustinGrote
Copy link
Contributor

JustinGrote commented Aug 22, 2021

I managed to tease out the failed objects from the job, the call depth overflow happens here:

Invoke-Assertion: C:\Users\JGrote\Documents\PowerShell\Modules\Pester\5.2.2\Pester.psm1:7682:17
Line |
7682 |  ...                Invoke-Assertion @assertionParams -ValueToTest $object
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The script failed due to call depth overflow.  
❯ $y[5].exception.data.'System.Management.Automation.Interpreter.InterpretedFrameInfo'

Should-Throw
<ScriptBlock>
Invoke-Block
<ScriptBlock>
Invoke-Block
<ScriptBlock>
Invoke-Block
<ScriptBlock>
Invoke-Block
<ScriptBlock>
<ScriptBlock>
<ScriptBlock>
Invoke-InNewScriptScope
Run-Test
Invoke-Test
Invoke-Pester<End>
<ScriptBlock>
❯ $y[5].exception.stacktrace       

   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at Invoke-Assertion(Closure , FunctionContext )
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
   at System.Management.Automation.CommandProcessorBase.Complete()

🚧/SecretManagement.KeePass 
❯ $y[5].exception.innerexception


ErrorRecord    : The script failed due to call depth overflow.
CallDepth      : 0
Message        : The script failed due to call depth overflow.
Data           : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException :
TargetSite     : Void CheckStackDepth()
StackTrace     :    at System.Management.Automation.ExecutionContext.CheckStackDepth()
                    at System.Management.Automation.CommandProcessorBase.DoExecute()
                    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
                    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput,
                 CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][]      
                 commandRedirections, FunctionContext funcContext)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)       
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame      
                 frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame      
                 frame)
HelpLink       :
Source         : System.Management.Automation
HResult        : -2146233087

@JustinGrote
Copy link
Contributor

JustinGrote commented Aug 22, 2021

To reproduce: Checkout https://github.com/JustinGrote/SecretManagement.KeePass and run ./build.ps1 on a windows machine, it'll fail on the Pester Test WindowsPowershell step. If you run only one or two files, the stacktrace error doesn't happen, if you run all test files it will. If you rearrange the test files, it'll generally happen on the third test file, regardless of what it is, similar to @rismoney "running It 3 times to force the issue"

Also it tends to happen on a test with a TestCase, tests placed before a TestCase test will pass before hitting the stacktrace limit on the TestCase
{FD255ECB-7C1C-49A9-9CEA-BF49ED2D4391}

@fflaten
Copy link
Collaborator

fflaten commented May 9, 2022

@rismoney @JustinGrote Any chance you both used the Integrated Console mode in VSCode with PowerShell-extension while experiencing this?

Just reported a somewhat similar issue in vscode-powershell as I'm only able to reproduce #2174 in vscode Integrated Console using PS5.1

@fflaten
Copy link
Collaborator

fflaten commented May 9, 2022

@rismoney @JustinGrote Any chance you both used the Integrated Console mode in VSCode with PowerShell-extension while experiencing this?

Just reported a somewhat similar issue in vscode-powershell as I'm only able to reproduce #2174 in vscode Integrated Console using PS5.1

Scratch that. Was able to reproduce using jobs in PS 5.1.

@fflaten
Copy link
Collaborator

fflaten commented May 22, 2022

Looks like PSRemoting etc. are running default maxstacksize for it's thread as @nohwnd mentions in this comment.

This is only 512KB vs the 10MB used in a normal Windows Powershell session. Marking as external bug/limitation.

@rismoney
Copy link
Contributor Author

In my use cases, it was not within vscode. It was over a regular powershell enter-pssession on to a windows 2019 server.

@fflaten
Copy link
Collaborator

fflaten commented May 22, 2022

In my use cases, it was not within vscode. It was over a regular powershell enter-pssession on to a windows 2019 server.

Yes, I'm aware. The referenced comment is confirming that PSRemoting has the same root cause as the vscode extension. The limitation is part of Powershell code itself so we're unable to fix it (increase thread maxstacksize).

@nohwnd
Copy link
Member

nohwnd commented May 26, 2022

I don't see any potential workaround on our side, and Windows PowerShell is unlikely to take this fix.

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

No branches or pull requests

4 participants