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
App Crash. Unhandled NullReference Exception while copying to remote session #16542
Closed
5 tasks done
Labels
Issue-Bug
Issue has been identified as a bug in the product
Resolution-Fixed
The issue is fixed.
WG-Remoting
PSRP issues with any transport layer
Comments
SergeyZalyadeev
added
the
Needs-Triage
The issue is new and needs to be triaged by a work group.
label
Dec 2, 2021
@SergeyZalyadeev Thanks for your investigations! Do you want to create PR? |
I'll try |
SergeyZalyadeev
pushed a commit
to SergeyZalyadeev/PowerShell
that referenced
this issue
Dec 30, 2021
22 tasks
PaulHigin
removed
the
Needs-Triage
The issue is new and needs to be triaged by a work group.
label
Jan 11, 2022
@WG-Remoting, Remoting working group agrees with the scenario and crash analysis. Thanks! |
SergeyZalyadeev
pushed a commit
to SergeyZalyadeev/PowerShell
that referenced
this issue
Jan 13, 2022
PaulHigin
pushed a commit
that referenced
this issue
Jan 13, 2022
Adding simple null checks appears to have resolved this issue. |
TrapGodBrim
pushed a commit
to TrapGodBrim/PowerShell
that referenced
this issue
Jan 19, 2022
…erShell#16683) * fix crash Copy-Item to remote session (PowerShell#16542) * update comments * remove lock (PowerShell#16542) Co-authored-by: Sergey Zalyadeev <sergey.zalyadeev@cayosoft.com>
🎉 Handy links: |
SergeyZalyadeev
added a commit
to SergeyZalyadeev/PowerShell
that referenced
this issue
Apr 4, 2022
…erShell#16683) * fix crash Copy-Item to remote session (PowerShell#16542) * update comments * remove lock (PowerShell#16542) Co-authored-by: Sergey Zalyadeev <sergey.zalyadeev@cayosoft.com>
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
Resolution-Fixed
The issue is fixed.
WG-Remoting
PSRP issues with any transport layer
Prerequisites
Steps to reproduce
$cred=[PSCredential]::New('user',(ConvertTo-SecureString 'password' -AsPlainText -Force))
$session = New-PSSession -Credential $cred
Copy-Item PathToLocalFile_10MB RemotePath -ToSession $session
Expected behavior
No crash
Actual behavior
Error details
No response
Environment data
Visuals
Race condition in threads
Dereference the member variable _dataToBeSent[1] when it has been cleared by the different thread that called Clear() method.
https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs#L217-L226
The stack of thread that cleared _dataToBeSent[1] member.
Simple Fix:
Insert lock and null check before dereferencing at line 226
https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs#L226
The text was updated successfully, but these errors were encountered: