PowerShell: pwsh segmentation fault when running -Command or -File
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
We have installed Powershell 7.3.1 using Yum on a Redhat 7.9 OS. We are getting an intermittent Segmentation Fault when attempting to run either a -File or a -Command using pwsh. It does not happen when we just run pwsh. The behavior is very strange. For example, if I run “pwsh -Command {Write-Host ‘hello’}” I will get Segmentation Fault, then after a few tries, it may (or may not) start working as expected. this will continue to work until after the weekend, then it stops working. I am trying to find out what the client sysadmins are doing on the weekend (probably running a Yum update, maybe a system reboot?) So yea, not a lot to go on.
Expected behavior
'hello'
Actual behavior
Segmentation Fault
Error details
Can't provide since Segmentation Fault occurs immediately.
Environment data
Name Value
---- -----
PSVersion 7.3.1
PSEdition Core
GitCommitId 7.3.1
OS Linux 3.10.0-1160.81.1.el7.x86_64 #1 SMP Thu Nov 24 12:21:22 UTC 2022
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
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (11 by maintainers)
The problem showed up again using 7.3.0. We removed the StartupProfileData-NonInteractive file under /home/<user-name>/.cache/powershell as recommended by Issue 18998 and pwsh with a -file argument began to work again!