pwsh segmentation fault when running -Command or -File
See original GitHub issuePrerequisites
- 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
Issue Analytics
- State:
- Created 8 months ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Powershell in Linux Segmentation Fault When You Exit
I noticed in different Linux distributions, When you exit pwsh by typing exit, it always closes with a segmentation fault.
Read more >Segmentation fault when not specifying input file on ...
I am writing a program that reads from a file passed as an arguement, or reads from stdin if no arguements are given....
Read more >Resolving Segmentation Fault (“Core dumped”) in Ubuntu
Segmentation fault is when your system tries to access a page of memory that doesn't exist. Core dumped means when a part of...
Read more >Identify what's causing segmentation faults (segfaults)
A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core...
Read more >PowerShell script language raising exception at the ...
When I choose PowerShell script language in my process step configuration, I run into a segmentation fault in the release deploy.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!
From https://github.com/dotnet/runtime/issues/81799#issuecomment-1458494879:
@bobrozelle I’m sorry that it turns out to be such an annoying blocking issue for you. I just posted the issue to the internal channel for the .NET team and hope we can get some traction by doing that.
At the meantime, can you please consider using v7.2.x of PowerShell instead? It’s a LTS version, the latest version is v7.2.10. We have NOT heard any reports about this “seg fault” issue with the v7.2.x versions, so you can avoid this issue by moving to v7.2 for now.