-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issue
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
There is something about the exception raised by Assembly.GetTypes()
that is causing Get-Error
to get stuck in some loop and use up all system resources. In dotnet 8 loading the System.Data.SqlClient
causes an error when attempting to get the types of that assembly. While this is a known problem attempting to use Get-Error
to produce more information causes the shell to hang and start to consume all the system resources.
I've narrowed it down to the formatting of this particular error record in the formatting code
Line 831 in b2ba584
Set-StrictMode -Off |
Types
or LoaderExceptions
in $Error[0].Exception.InnerException
.
Expected behavior
Add-Type -Assembly System.Data.SqlClient
# This will raise an exception
[System.Data.SqlClient.SqlCredential].Assembly.GetTypes()
# Calling Get-Error after "hangs"
Get-Error
Actual behavior
Shows the error without hanging
Error details
Nothing, it hangs
Environment data
Name Value
---- -----
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Arch Linux
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Metadata
Metadata
Assignees
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issue