Repository navigation
Process is terminating due to StackOverflowException #6813
Description
Activity
vexx32 commented
on May 3, 2018 CollaboratorMore actionsYou might want to leave a link to the module itself so we can actually see what's going on with it.
Florian Feldhaus (@ffeldhaus) Could you please make more simple repo?
ffeldhaus commented
on May 3, 2018 ContributorAuthorMore actionsWhile I don't think it's a problem of the module, as the issue did not occur with 6.1.0-preview.1 as well as 6.0.0, 6.0.1 and 6.0.2, here's the link to the sourcecode of the OnCommand-Insight Module:
https://github.com/ffeldhaus/OnCommand-InsightModule Download:
https://github.com/ffeldhaus/OnCommand-Insight/releases/download/4.2.2/OnCommand-Insight.zipModule on PowerShell Gallery:
https://www.powershellgallery.com/packages/OnCommand-InsightIlya (@iSazonov) How should I make a more simple repo? As I don't know what is causing the issue, I can't really narrow it down. Do you have any ideas for debugging the PowerShell crash?
vexx32 commented
on May 3, 2018 CollaboratorMore actionsI would look at splitting up that massive module file into individual functions, classes, etc.
In a file that big, you really have no good way of figuring out exactly which parts or combination of parts is really the issue. Even if you have a build script which compiles it into a singular PSM1, if at least you have the source well organised, you'll have a much easier time pinpointing what's going wrong.
ffeldhaus commented
on May 3, 2018 ContributorAuthorMore actionsRain Sallow (/u/ta11ow) (@vexx32) I could split the module into multiple files. I already thought about it, but I had some trouble with building a module consisting of multiple files during my last try and thus did not spend more time on this. Regardless of that, PowerShell should not just crash. If PowerShell throws an exception, it should indicate where the Exception was thrown. As I had no trouble with PowerShell 5.1, 6.0.0, 6.0.1, 6.0.2 and 6.1.0-preview.1 I expect this to be a problem introduced with fixes or improvement for 6.1.0-preview.2.
Any idea how to troubleshoot the issue?
vexx32 commented
on May 3, 2018 CollaboratorMore actionsThe only thing I think you can really do in a case like this is save the module somewhere locally (not installed), hook in a debugger, and manually import the module by pointing to the PSD1 filename. If it still crashes like this, see if you can find anything useful in the debug data as it's doing the import.
Any idea how to troubleshoot the issue?
Debugger.
You can review Release notes https://github.com/PowerShell/PowerShell/releasesffeldhaus commented
on May 3, 2018 ContributorAuthorMore actionsI tried to setup debugging according to https://github.com/PowerShell/PowerShell/blob/master/docs/debugging/README.md but as I do not have a Windows Coding environment at the moment and only limited C# experience, I expect that I won't be able to setup proper PowerShell Debugging within the next days.
That said, I consider this a ShowStopper for the release of 6.1. Not because it crashes during loading of my module, but because PowerShell should not Crash when loading a module which loads fine in previous releases.
I checked the Changelog and found that PR #6523 did extensive changes to the Module loading code. Maybe some behavior changed causing the crashes here.
As suggested I manually loaded the Module from file and discovered, that 6.1.0-preview.2 imports the
.psm1file without issues, but when importing the.psd1module manifest, the Exception is thrown.It would be great if someone with a working Debugging environment could check the following steps which should reproduce the issue and share the findings:
- Download the Module from https://github.com/ffeldhaus/OnCommand-Insight/releases/download/4.2.2/OnCommand-Insight.zip
- Unzip OnCommand-Insight.zip
Import-Module ./OnCommand-Insight.psd1
EDIT: I noted that the Module Manifest contains german comments with non ASCII characters like ä,ö,ü, maybe some code changes do not properly handle non ASCII characters in the Module Manifest
Dongbo Wang (@daxian-dbw) Could you please look the Issue
I checked the Changelog and found that PR #6523 did extensive changes to the Module loading code. Maybe some behavior changed causing the crashes here.
As suggested I manually loaded the Module from file and discovered, that 6.1.0-preview.2 imports the .psm1 file without issues, but when importing the .psd1 module manifest, the Exception is thrown.I see we catch an assert in line https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs#L3001
- addedIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the product
on May 4, 2018 Related Issue #6818
Florian Feldhaus (@ffeldhaus) Your manifest file seems to contain a circular reference
RootModule = 'OnCommand-Insight'
NestedModules = @('OnCommand-Insight')Please remove second line and test.
Dup #5565
Florian Feldhaus (@ffeldhaus) Thanks for reporting the bug. This is a regression introduced from #6523, in
PSModuleInfo.cs. A circular nested module check was removed because the comment there suggested it happens only with a deprecated workflow module. This causes aStackOverflowexception when running into circular nested modules.As Ilya (@iSazonov) pointed out, your module manifest is not well structured. The
RootModuleshouldn't be put in theNestedModulesagain, though that shouldn't make powershell crash.Reacted by Ilya- addedWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesand removed
on Jul 17, 2026
Since installing 6.1.0-preview.2 I get an StackOverflowException soon after I start PowerShell. This occurs on Mac OS X and Windows 10. This did not occur on 6.1.0-preview.1.
I suspect it has to do with my Module
OnCommand-Insightas the issue did not occur when the module was not installed.Steps to reproduce
Install 6.1.0-preview.2, then
Restart PowerShell
Environment data
Mac OS X
On Windows I was not fast enough, thus I edited the output from the 6.0.0 installation which is running fine: