Skip to content

DivideByZeroException when running Docker container from mcr.microsoft.com/powershell:latest #2844

@reed9999

Description

@reed9999

I presently don't have enough PowerShell or Docker expertise to intuit whether this is important. I don't see any obvious duplicates (#670 might be related).

The logs included the following, which seems to the same as output produced by the scripts in this template.

Oops, something went wrong.

Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.

Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md

Thank you!


### Environment

PSReadLine: 2.1.0
PowerShell: 7.1.4
OS: Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021
BufferWidth: 0
BufferHeight: 0

Last 200 Keys

 8 � � � m U @ @ Spacebar @ @ @ @ @ @ @ @ � N ! � > } � 8 � � � m U @ @ Ctrl+b @ @ @ @ @ @ @ � O Backspace ] S Backspace @ @ � Ctrl+n � � S Backspace @ @ � � t 0 S Backspace @ @ @ � N ! � > } � @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ � � K e S Backspace @ @ X Ctrl+q ' � S Backspace @ @ � P Backspace ] S Backspace @ @ ! � � � S Backspace @ @ � 1 } Ctrl+l @ @ @ @ X Ctrl+q ' � S Backspace @ @ @ @ @ @ @ @ @ @ � O Backspace ] S Backspace @ @ � O Backspace ] S Backspace @ @ " ) � � S Backspace @ @ @ @ @ @ @ @ @ @ � � * e S Backspace @ @ � P Backspace ] S Backspace @ @ h � U e S Backspace @ @



### Exception

System.DivideByZeroException: Attempted to divide by zero.

   at Microsoft.PowerShell.PSConsoleReadLine.PhysicalLineCount(Int32 columns, Boolean isFirstLogicalLine, Int32& lenLastPhysicalLine)

   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)

   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()

   at Microsoft.PowerShell.PSConsoleReadLine.BackwardDeleteChar(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 removed the triple-backticks so I could use triple backticks here. I also manually deleted some empty lines to make it single spaced; apparently that's a copy/paste issue from my shell.)

Environment

I managed to run the script given here in the CLI for my container; it produced the following, which I think just repeats what's above:

PS version: 7.1.4
PSReadline version: 2.1.0
os: Linux ee4a2cd279b6 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
PS file version: 7.1.4.0
HostName: ConsoleHost
BufferWidth: 120
BufferHeight: 30

Exception report

See above (?)

Steps to reproduce

  • A few days ago, I downloaded the mcr.microsoft.com/powershell Docker image to my three-month-old Windows 10 personal laptop. 6eee80913d43 is the image ID.
  • Used it to start a container, but because Docker Dashboard didn't update, I didn't realize the container was running.
  • In Docker Dashboard, I found the container running and checked the logs, which included the following:

Expected behavior

Presumably it's expected to work, in which case the log would not tell me to submit an issue on Github.

Actual behavior

The logs asked me to file an issue and gave me the text above to include here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions