8000 PowerShell cannot have a pipeline with more then 2 native processes with redirected stdin · Issue #3321 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

PowerShell cannot have a pipeline with more then 2 native processes with redirected stdin #3321

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
vors opened this issue Mar 13, 2017 · 12 comments
Assignees
Labels
Issue-Bug Issue has been identified as a bug in the product OS-Linux OS-macOS Resolution-External The issue is caused by external component(s). Resolution-Fixed The issue is fixed. WG-Engine core PowerShell engine, interpreter, and runtime
Milestone

Comments

@vors
Copy link
Collaborator
vors commented Mar 13, 2017

Steps to reproduce

ps aux | grep powershell | grep -v grep

Expected behavior

Return filtered results. I.e. same as

PS > $a = ps aux | grep powershell; $a | grep -v grep
vors          2995   7.4  0.3  4813880  44460 s000  S+   11:07AM   0:10.07 -powershell
vors          6628   0.0  0.1  4810520  19192 s001  S+   11:35AM   0:02.51 -powershell

Actual behavior

Pipeline hanging (first grep never receives "output closed" event, besides the fact that corresponding stream is disposed)

Environment data

> $PSVersionTable
Name                           Value                                                                                                                                                       
----                           -----                                                                                                                                                       
PSVersion                      6.0.0-alpha                                                                                                                                                 
PSEdition                      Core                                                                                                                                                        
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                     
BuildVersion                   3.0.0.0                                                                                                                                                     
GitCommitId                    v6.0.0-alpha.17                                                                                                                                             
CLRVersion                                                                                                                                                                                 
WSManStackVersion              3.0                                                                                                                                                         
PSRemotingProtocolVersion      2.3                                                                                                                                                         
SerializationVersion           1.1.0.1    
@vors vors added WG-Engine core PowerShell engine, interpreter, and runtime OS-Linux OS-macOS labels Mar 13, 2017
@iSazonov iSazonov added the Issue-Bug Issue has been identified as a bug in the product label Mar 15, 2017
@vors vors self-assigned this Mar 22, 2017
@vors vors changed the title Native command pipeline hang PowerShell cannot have a pipeline with more then 2 native processes with redirected stdin Mar 22, 2017
@vors vors added the Blocked blocked on something external to this repo label Mar 22, 2017
@vors
Copy link
Collaborator Author
vors commented Mar 22, 2017

It's blocked on https://github.com/dotnet/corefx/issues/13447

I'd treat it is a high priority, because it makes impossible to have any pipeline with 2 or more native commands (when both have stdin redirected).

The simpler repro is 1 | grep 1 | grep 1

@SteveL-MSFT SteveL-MSFT added this to the 6.0.0-beta1 milestone Mar 22, 2017
@SteveL-MSFT
Copy link
Member

CC @joeyaiello

@vors vors removed their assignment Mar 23, 2017
@HemantMahawar HemantMahawar modified the milestones: 6.0.0-beta2, 6.0.0-beta1 Mar 27, 2017
@SteveL-MSFT SteveL-MSFT modified the milestones: 6.0.0-beta, 6.0.0 May 15, 2017
@joeyaiello joeyaiello modified the milestones: 6.0.0-HighPriority, 6.0.0 May 15, 2017
@daxian-dbw
Copy link
Member

I submitted a PR to fix dotnet/corefx#13447. The PR is at dotnet/corefx#19988

@daxian-dbw
Copy link
Member
daxian-dbw commented May 20, 2017

The PR has been merged to dotnet/master and ported to release/2.0 branch.: dotnet/corefx#20001

I also verified that this issue doesn't repro with the fix in .NET Core 2.0:

PS /home> ps aux | grep powershell | grep -v grep                                            
dongbo   22410  4.0  0.8 3697196 104800 pts/2  SLl+ 17:02   0:04 powershell
PS /home>

Hence, I'm closing this issue.

@daxian-dbw daxian-dbw added the Resolution-External The issue is caused by external component(s). label May 20, 2017
@SteveL-MSFT SteveL-MSFT added the Resolution-Fixed The issue is fixed. label May 20, 2017
@iSazonov iSazonov removed the Blocked blocked on something external to this repo label May 20, 2017
@vors
Copy link
Collaborator Author
vors commented May 26, 2017

@daxian-dbw that's awesome, thank you so much!!

@vors vors reopened this Jun 3, 2017
@vors
Copy link
Collaborator Author
vors commented Jun 3, 2017

I get the old behavior on beta-2

image

@SteveL-MSFT
Copy link
Member

Did we not have a test for this?

@vors
Copy link
Collaborator Author
vors commented Jun 4, 2017

@daxian-dbw is it just not yet included in the dotnet packages we consume?

@daxian-dbw
Copy link
Member

We haven't moved to the lastest dotnet preview2 packages yet because preview2 packages will break VSCode. preview2 packages are not supported by VSCode C# extension at this moment, see dotnet/vscode-csharp#1495

@daxian-dbw
Copy link
Member

PowerShell has moved to the latest 2.0.0-preview2 packages via #3887.
A test is also added with #4012 to cover this scenario.

@daxian-dbw
Copy link
Member

We are moving back to .NET Core 2.0.0-preview1 via PR #4026 due to regressions in the latest .NET Core 2.0.0-preview2 (https://github.com/dotnet/corefx/issues/21095). So re-open this bug.

@daxian-dbw
Copy link
Member

We finally moved to .NET Core 2.0.0-preview3 via PR #4144.
I have verified this issue has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Issue has been identified as a bug in the product OS-Linux OS-macOS Resolution-External The issue is caused by external component(s). Resolution-Fixed The issue is fixed. WG-Engine core PowerShell engine, interpreter, and runtime
Projects
None yet
Development

No branches or pull requests

6 participants
0