Skip to content

ArgumentOutOfRangeException in 2.0.0 GA version #1469

Closed

Description

Error message said I should report this so here it goes:

E:\projects\MSBuildStaticGraphTester [transitiveReferences +7 ~5 -0 !]> .\src\out\Release\bin\GraphGen\net472\GraphGen.exe E:\projects\roslyn\src\NuGet\Microsoft.Net.Compilers.Toolset\Microsoft.Net.Compilers.Toolset.Package.csproj package.pdf "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Mstart .\package_PathsEndingIn_vbc.csproj.pdf
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 7.0.0
OS: Microsoft Windows 10.0.18363
Last 200 Keys
 Enter
 s t a r t Spacebar p a Tab Tab Enter
 UpArrow UpArrow DownArrow DownArrow Spacebar Backspace Backspace Backspace g i t Spacebar s t a t u s Enter
 . . \ d e Tab Spacebar Tab Tab Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace - Tab Spacebar E n t e r p r i s e Enter
 UpArrow UpArrow UpArrow UpArrow Enter
 s t a r t Spacebar p a Tab Tab Enter
 UpArrow UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow " " Spacebar LeftArro
w LeftArrow Ctrl+v Enter
 UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow
 Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+RightArrow Ctrl+LeftArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl
+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow RightArrow RightArro
w RightArrow RightArrow LeftArrow Shift+Ctrl+LeftArrow Shift+Ctrl+LeftArrow Ctrl+x Backspace Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+Lef
tArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+RightArrow LeftArrow Ctrl+v Spacebar Enter
 s t a r t Spacebar p a c k Tab Tab Enter
 UpArrow UpArrow DownArrow DownArrow UpArrow UpArrow DownArrow

Exception

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was 55.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.UpdateFromHistory(HistoryMoveCursor moveCursor)
   at Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction)
   at Microsoft.PowerShell.PSConsoleReadLine.NextHistory(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

I was going through the command history with the up / down keys when this happened.

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Apr 13, 2020
  2. iSazonov commented on Apr 14, 2020

    @iSazonov
  3. petacreepers23 commented on Apr 15, 2020

    @petacreepers23
  4. daxian-dbw commented on Apr 20, 2020

    @daxian-dbw
    Member

    This happened with PSReadLine 2.0.0, so it's something new.

    Mihai Codoban (@cdmihai) Can you please run the script below in the pwsh session where you run into this issue to collect the environment data?
    Also, are you able to consistently reproduce the issue? If so, can you please provide the repro steps (including your history commands that triggers the issue when using up/down keys)?

    & {
        $hostName = $Host.Name
        if ($hostName -eq "ConsoleHost" -and (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)) {
            $id = $PID
            $inWindowsTerminal = $false
            while ($true) {
                $p = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId Like $id"
                if (!$p -or !$p.Name) { break }
                if ($p.Name -eq "WindowsTerminal.exe") { $inWindowsTerminal = $true; break }
                $id = $p.ParentProcessId
            }
            if ($inWindowsTerminal) { $hostName += " (Windows Terminal)" }
        }
    
        "`nPS version: $($PSVersionTable.PSVersion)"
        $m = Get-Module PSReadline
        $v = $m.Version; $pre = $m.PrivateData.PSData.Prerelease
        if ($pre) { $v = "$v-$pre" }
        "PSReadline version: $v"
        if ($IsLinux -or $IsMacOS) {
            "os: $(uname -a)"
        } else {
            "os: $((dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion)"
        }
        "PS file version: $($name = if ($PSVersionTable.PSEdition -eq "Core") { "pwsh.dll" } else { "powershell.exe" }; (dir $pshome\$name).VersionInfo.FileVersion)"
        "HostName: $hostName"
        "BufferWidth: $([console]::BufferWidth)"
        "BufferHeight: $([console]::BufferHeight)`n"
    }
  5. changed the title [-]System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')[/-] [+]ArgumentOutOfRangeException happens in PSReadLine of version 2.0.0[/+] on Apr 21, 2020
  6. cdmihai commented on Apr 22, 2020

    @cdmihai
    Author

    Can you please run the script below in the pwsh session where you run into this issue to collect the environment data?

    I've restarted multiple times since then, so that pwsh session is long gone. Does it still make sense to run the script?

    Also, are you able to consistently reproduce the issue?

    It only happened once. If it happens again, I'll run the script snippet you mentioned, and preserve the command history I was browsing through.

  7. iSazonov commented on Apr 22, 2020

    @iSazonov

    Dongbo Wang (@daxian-dbw) Maybe collect exceptions for telemetry?

  8. daxian-dbw commented on Apr 22, 2020

    @daxian-dbw
    Member

    If it happens again, I'll run the script snippet you mentioned, and preserve the command history I was browsing through.

    Mihai Codoban (@cdmihai) Yes, please do report back with those additional information if it happens to you again. Thanks!

    Ilya (@iSazonov) I don't think the exception would be that interesting. A repro is what we desperately need :)

  9. iSazonov commented on Apr 22, 2020

    @iSazonov

    I don't think the exception would be that interesting. A repro is what we desperately need :)

    My thoughts is that console applications is very sensitive and having all that we have with your script could be useful in telemetry.

  10. petacreepers23 commented on Apr 22, 2020

    @petacreepers23
  11. daxian-dbw commented on Apr 22, 2020

    @daxian-dbw
  12. daniel0x00 commented on Apr 26, 2020

    @daniel0x00
  13. jhoneill commented on Apr 29, 2020

    @jhoneill
  14. daxian-dbw commented on Apr 29, 2020

    @daxian-dbw
  15. jhoneill commented on Apr 29, 2020

    @jhoneill
  16. iSazonov commented on Apr 30, 2020

    @iSazonov
  17. jhoneill commented on Apr 30, 2020

    @jhoneill
  18. daxian-dbw commented on May 1, 2020

    @daxian-dbw
  19. changed the title [-]ArgumentOutOfRangeException happens in PSReadLine of version 2.0.0[/-] [+]ArgumentOutOfRangeException in 2.0.0 GA version[/+] on May 22, 2020
  20. ghost closed this as completedon Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions