PowerShell / PowerShell/PowerShell

PowerShell crash when exiting Flatpak debugging shell

Open
#26,939 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Triage
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Prerequisites
Steps to reproduce
  1. Start a PowerShell session
  2. Enter a debugging shell for any flatpak package in that PowerShell session, e.g. flatpak run --command=bash com.collaboraoffice.Office
  3. Press Control+D to exit that shell
Expected behavior
The Flatpak debugging successfully quits without bring down PowerShell too.
Actual behavior
PS /> flatpak run --command=bash com.collaboraoffice.Office 
[📦 com.collaboraoffice.Office /]$ 
exit
^[[22;1RProcess terminated. Input/output error
   at System.Environment.FailFast(System.Runtime.CompilerServices.StackCrawlMarkHandle, System.String, System.Runtime.CompilerServices.ObjectHandleOnStack, System.String)
   at System.Environment.FailFast(System.Threading.StackCrawlMark ByRef, System.String, System.Exception, System.String)
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String[], Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
System.IO.IOException: Input/output error
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at System.ConsolePal.TryGetCursorPosition(Int32& left, Int32& top, Boolean reinitializeForRead)
   at System.ConsolePal.GetCursorPosition()
   at System.Console.get_CursorLeft()
   at Microsoft.PowerShell.ConsoleHostRawUserInterface.get_CursorPosition()
   at Microsoft.PowerShell.ConsoleHost.InputLoop.Run(Boolean inputLoopIsNested)
   at Microsoft.PowerShell.ConsoleHost.InputLoop.RunNewInputLoop(ConsoleHost parent, Boolean isNested)
   at Microsoft.PowerShell.ConsoleHost.EnterNestedPrompt()
   at Microsoft.PowerShell.ConsoleHost.DoRunspaceLoop(String initialCommand, Boolean skipProfiles, Collection`1 initialCommandArgs, Boolean staMode, String configurationName, String configurationFilePath)
   at Microsoft.PowerShell.ConsoleHost.Run(CommandLineParameterParser cpp, Boolean isPrestartWarned)
   at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText, Boolean issProvidedExternally)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[] args, Int32 argc)
Error details

Environment data
PS /> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             openSUSE Tumbleweed
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash with the Flatpak debugging-shell command and Control+D, then trace the reported path through Microsoft.PowerShell.ConsoleHost.InputLoop and System.ConsolePal.TryGetCursorPosition. Compare the nested prompt and console state before and after the shell exits; done means returning to PowerShell without the Input/output error or FailFast crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.