Entering badly formed command crashes terminal; Not possible to start new instance. #8512

Closed
opened 2026-01-31 01:31:22 +00:00 by claunia · 2 comments
Owner

Originally created by @steveblomeley on GitHub (May 22, 2020).

Environment

Windows build number: 10.0.18363.778
Windows Terminal version (if applicable): 0.11.1191.0

Any other software? N/A

Steps to reproduce

Running windows terminal at Powershell prompt
Entered a malformed command (a git checkout, but forgot to prefix the command with "git")

> checkout 3.1.3

Expected behavior

An error message indicating that "checkout" is not a valid powershell command

Actual behavior

Terminal crashes with error.
Cannot open new instance of windows terminal (same error).
Cannot open new powershell window (same error):

Unhandled Exception:Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.Utils' threw an exception. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Collections.Generic.Dictionary2..ctor(Int32 capacity, IEqualityComparer1 comparer)
at System.Management.Automation.Utils..cctor()
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.EarlyStartup.<>c.b__0_0()
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at RunspaceInit.get_ResourceManager()
at RunspaceInit.get_OutputEncodingDescription()
at System.Management.Automation.Runspaces.EarlyStartup.<>c.b__0_1()
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.ThreadPoolWorkQueue.Dispatch()

[process exited with code 3221225477]

Originally created by @steveblomeley on GitHub (May 22, 2020). # Environment Windows build number: 10.0.18363.778 Windows Terminal version (if applicable): 0.11.1191.0 Any other software? N/A # Steps to reproduce Running windows terminal at Powershell prompt Entered a malformed command (a git checkout, but forgot to prefix the command with "git") > \> checkout 3.1.3 # Expected behavior An error message indicating that "checkout" is not a valid powershell command # Actual behavior Terminal crashes with error. Cannot open new instance of windows terminal (same error). Cannot open new powershell window (same error): Unhandled Exception:Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.Utils' threw an exception. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Collections.Generic.Dictionary`2..ctor(Int32 capacity, IEqualityComparer`1 comparer) at System.Management.Automation.Utils..cctor() --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.EarlyStartup.<>c.<Init>b__0_0() at System.Threading.Tasks.Task.Execute() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.ThreadPoolWorkQueue.Dispatch() System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at RunspaceInit.get_ResourceManager() at RunspaceInit.get_OutputEncodingDescription() at System.Management.Automation.Runspaces.EarlyStartup.<>c.<Init>b__0_1() at System.Threading.Tasks.Task.Execute() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.ThreadPoolWorkQueue.Dispatch() [process exited with code 3221225477]
Author
Owner

@zadjii-msft commented on GitHub (May 22, 2020):

What the heck 😨

I've never seen anything like this. Maybe the file for the command history for PsReadline is corrupted, and that's what's preventing further instances from running? I honestly have no idea.

You might have better luck searching on https://github.com/powershell/powershell or https://github.com/lzybkr/psreadline

@zadjii-msft commented on GitHub (May 22, 2020): What the _heck_ 😨 I've never seen anything like this. Maybe the file for the command history for PsReadline is corrupted, and that's what's preventing further instances from running? I honestly have no idea. You might have better luck searching on https://github.com/powershell/powershell or https://github.com/lzybkr/psreadline
Author
Owner

@ghost commented on GitHub (Jun 1, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Jun 1, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8512