Repository navigation
System.DivideByZeroException within pwsh on linux #618
Description
Activity
I didn't see any obvious places where this division could take place. If it's easy for you to debug and find the exact line, that would expedite a fix.
My hands are a bit full at the moment, and this is not blocking me, but i see older closed issues with the same exception type in PSReadline. I'm not a dotnet guy, so i'm not sure how to debug this... Any pointers welcome.
Also running into this with Debian 9
PowerShell v6.0.1 Copyright (c) Microsoft Corporation. All rights reserved. https://aka.ms/pscore6-docs Type 'help' to get help. PS /home/jenkins> Oops, something went wrong. Please report this bug with the details below. Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new ----------------------------------------------------------------------- Last 0 Keys: Exception: System.DivideByZeroException: Attempted to divide by zero. at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics) at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics) -----------------------------------------------------------------------PS version: 6.0.1 PSReadline version: 1.2 os: Linux 12d4c04b1f0f 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 GNU/LinuxDebian 9 Stretch
Also, there isn'tpowershell.exein linux version, it is calledpwshI am not sure if it is the situation, but in Completion.cs, there is
Rows = (matches.Count + columns - 1) / columnswhich could result in0ifcolumns = 1. And then later on isColumnWidth * (selectedItem / Rows), which would result in adivision by 0.I did not see anything specific in
PSConsoleReadLine.I will add, this does seem promising, because completion of arguments is not working.
More information.
It only happens if I launch directly in to
pwsh. if I launch/bin/bashthenpwsh, i do not get the error.Have the same issue with the vsts container as described by Le Stephane (@lestephane) .
Container I use getting the issue: https://github.com/microsoft/vsts-agent-docker/blob/3a81525044b23e87b75d3f6b4c7e4feb2d0dca3e/ubuntu/16.04/tfs/2017-u1/standard/DockerfileIts blocking us because we could not use azure powershell sdk https://docs.microsoft.com/de-de/powershell/azure/install-azurermps-maclinux?view=azurermps-5.5.0
could you please look into this
I tried on a Debian 9 container, and couldn't reproduce the crash. Never tried on VSTS container though.
root@1ed6879ac3d8:/# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" root@1ed6879ac3d8:/# root@1ed6879ac3d8:/# pwsh PowerShell v6.0.2 Copyright (c) Microsoft Corporation. All rights reserved. https://aka.ms/pscore6-docs Type 'help' to get help. PS /> gmo ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable,... Script 2.0.0 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadL...One thing to point out, the crash posted by Ryan Conrad (@camalot) at #618 (comment) is with PSReadline 1.2.
Dongbo Wang (@daxian-dbw) I added the container link which I can reproduce the issue
joachimaumann I cannot reproduce the crash with the docker image
microsoft/vsts-agent.
Could this be related to the host OS? Can you please provide detailed repro steps?
Please see the screenshot below:I'm not longer able to reproduce with the latest image
REPOSITORY TAG IMAGE ID CREATED SIZE microsoft/vsts-agent latest 3b66c4a0d020 5 days ago 5.72GBSo OK to close?
- As far as I'm concerned, yes.…On Sun, Apr 1, 2018 at 9:35 PM, Jason Shirk ***@***.***> wrote: So OK to close? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#618 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFNTlDSO09KMN47KgjZOAXIMFquUj6A7ks5tkR4NgaJpZM4RcrAm> .
OK, closing.

Environment data
Steps to reproduce or exception report
<id of the container just started>/bin/bash