DbgShell icon indicating copy to clipboard operation
DbgShell copied to clipboard

Crash when trying to ToUpper() DbgEng> outputs

Open alastorid opened this issue 1 year ago • 0 comments

The DbgShell command to reproduce the issue:

?? `@`$peb|%{ $_.ToUpper() }

Crash stack and DbgShell command line

... # DbgShell.exe
Microsoft Debugger DbgShell
Copyright (c) 2015

Welcome.

Note that script execution policy is 'Bypass' for this process.
Run 'Get-Help about_DbgShell_GettingStarted' to learn about DbgShell.


PS Dbg:\
> ?? `@`$peb|%{ $_.ToUpper() }
Out-Default: OH NOES: The command code 'M' (0x4d) is not supported.
Out-Default: OH NOES: The command code 'o' (0x6f) is not supported.

Unhandled Exception: System.Management.Automation.CmdletInvocationException: The command code 'o' (0x6f) is not supported. ---> System.NotSupportedException: The command code 'o' (0x6f) is not supported.
   at MS.DbgShell.ConsoleControl.AnsiColorWriter._FindCommand(Char commandChar, Action`1& command) in C:\src\DbgShell\DbgShell\ConsoleControl.AnsiColorWriter.cs:line 244
   at MS.DbgShell.ConsoleControl.AnsiColorWriter._HandleControlSequence(String s, Int32 escIndex) in C:\src\DbgShell\DbgShell\ConsoleControl.AnsiColorWriter.cs:line 205
   at MS.DbgShell.ConsoleControl.AnsiColorWriter.Write(SafeFileHandle handle, String s) in C:\src\DbgShell\DbgShell\ConsoleControl.AnsiColorWriter.cs:line 158
   at MS.DbgShell.ConsoleControl.WriteConsole(SafeFileHandle consoleHandle, String output) in C:\src\DbgShell\DbgShell\ConsoleControl.cs:line 2767
   at MS.DbgShell.ConsoleTextWriter.Write(String value) in C:\src\DbgShell\DbgShell\ConsoleTextWriter.cs:line 60
   at MS.DbgShell.ColorHostUserInterface.Write(ConsoleColor foregroundColor, ConsoleColor backgroundColor, String value) in C:\src\DbgShell\DbgShell\ColorHostUserInterface.cs:line 799
   at System.Management.Automation.Host.PSHostUserInterface.WriteLine(ConsoleColor foregroundColor, ConsoleColor backgroundColor, String value)
   at Microsoft.PowerShell.Commands.Internal.Format.ConsoleLineOutput.OnWriteLine(String s)
   at Microsoft.PowerShell.Commands.Internal.Format.ConsoleLineOutput.WriteLine(String s)
   at Microsoft.PowerShell.Commands.Internal.Format.ComplexWriter.WriteToScreen()
   at Microsoft.PowerShell.Commands.Internal.Format.ComplexWriter.WriteObject(List`1 formatValueList)
   at Microsoft.PowerShell.Commands.Internal.Format.OutCommandInner.ProcessPayload(FormatEntryData fed, OutputContext c)
   at Microsoft.PowerShell.Commands.Internal.Format.OutCommandInner.ProcessObject(PSObject so)
   at Microsoft.PowerShell.Commands.Internal.Format.OutCommandInner.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at MS.DbgShell.ColorConsoleHost._ReportException(Exception e, PowerShell shell) in C:\src\DbgShell\DbgShell\ColorConsoleHost.cs:line 857
   at MS.DbgShell.ColorConsoleHost.InputLoop.Run() in C:\src\DbgShell\DbgShell\ColorConsoleHost.cs:line 426
   at MS.DbgShell.ColorConsoleHost.Run(CommandLineParameterParser cpp) in C:\src\DbgShell\DbgShell\ColorConsoleHost.cs:line 1188
   at MS.DbgShell.ColorConsoleHost.Start(RunspaceConfiguration configuration, String bannerText, String helpText, String[] args) in C:\src\DbgShell\DbgShell\ColorConsoleHost.cs:line 1225
   at MS.DbgShell.MainClass.MainWorker(String[] args) in C:\src\DbgShell\DbgShell\MainClass.cs:line 828
   at MS.DbgShell.MainClass._NormalModeMainWrapper(String[] args) in C:\src\DbgShell\DbgShell\MainClass.cs:line 526
   at MS.DbgShell.MainClass.Main(String[] args) in C:\src\DbgShell\DbgShell\MainClass.cs:line 132

The version of DbgShell is:

0:000> lmDvm DbgShell
Browse full module list
start             end                 module name
00000001`40000000 00000001`4002c000   DbgShell   (deferred)             
    Image path: R:\fff\DbgShell\DbgShell\x64\DbgShell.exe
    Image name: DbgShell.exe
    Browse all global symbols  functions  data
    Has CLR image header, track-debug-data flag not set
    Timestamp:        Thu May  9 00:11:48 2019 (5CD2FFC4)
    CheckSum:         00000000
    ImageSize:        0002C000
    File version:     0.8.26.0
    Product version:  0.8.65535.65535
    File flags:       0 (Mask 3F)
    File OS:          4 Unknown Win32
    File type:        1.0 App
    File date:        00000000.00000000
    Translations:     0409.04b0
    Information from resource tables:
        CompanyName:      Microsoft
        ProductName:      DbgShell
        ProductVersion:   0.8
        FileVersion:      0.8.26.0 (inputHash 943ce528, from branch master, commit a84b57a48a)
        FileDescription:  Main DbgShell EXE: implements the PowerShell host.
        LegalCopyright:   Copyright (c) 2017

0:000> lmDvm dbgeng
Browse full module list
start             end                 module name
00007ff8`5f800000 00007ff8`5ff32000   dbgeng     (deferred)             
    Image path: R:\fff\DbgShell\DbgShell\x64\Debugger\dbgeng.dll
    Image name: dbgeng.dll
    Browse all global symbols  functions  data
    Image was built with /Brepro flag.
    Timestamp:        387CE7A3 (This is a reproducible build file hash, not a timestamp)
    CheckSum:         007000B0
    ImageSize:        00732000
    File version:     10.0.17763.132
    Product version:  10.0.17763.132
    File flags:       0 (Mask 3F)
    File OS:          40004 NT Win32
    File type:        2.0 Dll
    File date:        00000000.00000000
    Translations:     0409.04b0
    Information from resource tables:
        CompanyName:      Microsoft Corporation
        ProductName:      Microsoft® Windows® Operating System
        InternalName:     DbgEng.Dll
        OriginalFilename: DbgEng.Dll
        ProductVersion:   10.0.17763.132
        FileVersion:      10.0.17763.132 (WinBuild.160101.0800)
        FileDescription:  Windows Symbolic Debugger Engine
        LegalCopyright:   © Microsoft Corporation. All rights reserved.

alastorid avatar Jul 11 '24 13:07 alastorid