Using wmic from zsh (cygwin) causes conhost to crash #7205

Closed
opened 2026-01-31 00:57:45 +00:00 by claunia · 8 comments
Owner

Originally created by @Elepover on GitHub (Mar 30, 2020).

Environment

Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.10.781.0

Any other software?
zsh (from cygwin package manager)

Steps to reproduce

  1. Type wmic <- First round
  2. Press Ctrl-C
  3. Type wmic again <- Second round
  4. Press Ctrl-C

Then OpenConsole.exe crashes with exit code 1.

Expected behavior

Other shells work just fine (w/ and wo/ Windows Terminal), only zsh causes OpenConsole.exe to crash.

Bash
Image

Bash (from cygwin, running with Windows Terminal)
Image

Git Bash (MINGW64)
Image

Windows PowerShell, running with Windows Terminal
Image

Windows Command Prompt, running with Windows Terminal
Image

zsh, first round
Image

zsh, second round before pressing Ctrl-C
Image

zsh, second round after pressing Ctrl-C
Image

(I didn't scroll the console window, it looks like the console just scrolled itself)

Actual behavior

When you do the first time, nothing abnormal happens
Image

If you do it again, OpenConsole.exe crashes and Windows Error Reporting prompts up.
Image

leaving output: [process exited with code 1]

Although I used oh-my-zsh for customization, zsh itself without any modification will crash OpenConsole.exe to crash, too.

My guess is that zsh printed something corrupt that OpenConsole.exe cannot handle. And zsh is the only shell that outputs a little % after Ctrl-C is pressed.

Originally created by @Elepover on GitHub (Mar 30, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18362.0 Windows Terminal version (if applicable): 0.10.781.0 Any other software? zsh (from cygwin package manager) ``` # Steps to reproduce 1. Type `wmic` <- First round 2. Press Ctrl-C 3. Type `wmic` again <- Second round 4. Press Ctrl-C Then `OpenConsole.exe` crashes with exit code 1. <!-- A description of how to trigger this bug. --> # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> Other shells work just fine (w/ and wo/ Windows Terminal), only zsh causes `OpenConsole.exe` to crash. **Bash** ![Image](https://user-images.githubusercontent.com/11826985/77884602-f5f00f00-7297-11ea-8249-b1c0705b6230.png) **Bash (from cygwin, running with Windows Terminal)** ![Image](https://user-images.githubusercontent.com/11826985/77883929-a826d700-7296-11ea-81e9-612baf00a66f.png) **Git Bash (MINGW64)** ![Image](https://user-images.githubusercontent.com/11826985/77884471-b9bcae80-7297-11ea-9616-f8b70254105c.png) **Windows PowerShell, running with Windows Terminal** ![Image](https://user-images.githubusercontent.com/11826985/77883969-bd036a80-7296-11ea-8691-7bc6c579e989.png) **Windows Command Prompt, running with Windows Terminal** ![Image](https://user-images.githubusercontent.com/11826985/77884024-d86e7580-7296-11ea-8776-034713c43d34.png) **zsh, first round** ![Image](https://user-images.githubusercontent.com/11826985/77884750-42d3e580-7298-11ea-9afa-6bb8f32ca69b.png) **zsh, second round before pressing Ctrl-C** ![Image](https://user-images.githubusercontent.com/11826985/77884801-5b440000-7298-11ea-9adf-0513f81210fb.png) **zsh, second round after pressing Ctrl-C** ![Image](https://user-images.githubusercontent.com/11826985/77884842-6ac34900-7298-11ea-97f4-e841221c54f3.png) (I didn't scroll the console window, it looks like the console just scrolled itself) # Actual behavior When you do the first time, nothing abnormal happens ![Image](https://user-images.githubusercontent.com/11826985/77884068-f045f980-7296-11ea-9c81-d3959f05d625.png) If you do it again, `OpenConsole.exe` crashes and Windows Error Reporting prompts up. ![Image](https://user-images.githubusercontent.com/11826985/77884100-02c03300-7297-11ea-99d0-dffe5d52c97f.png) leaving output: `[process exited with code 1]` Although I used oh-my-zsh for customization, zsh itself **without any modification** will crash OpenConsole.exe to crash, too. My guess is that zsh printed something corrupt that `OpenConsole.exe` cannot handle. And zsh is the only shell that outputs a little `%` after Ctrl-C is pressed. <!-- What's actually happening? -->
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 30, 2020):

Triage notes: wmic sets the screen to be 1500x300 characters (which is insane); when zsh later attempts to clear part of the screen we try to access a character that's out of bounds.

@DHowett-MSFT commented on GitHub (Mar 30, 2020): Triage notes: `wmic` sets the screen to be 1500x300 characters (which is insane); when zsh later attempts to clear part of the screen we try to access a character that's out of bounds.
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 30, 2020):

This reproduces in the windows console host if the buffer size and screen size are set to the same thing. Even in Windows 20H1.

@DHowett-MSFT commented on GitHub (Mar 30, 2020): This reproduces in the windows console host _if_ the buffer size and screen size are set to the same thing. Even in Windows 20H1.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 3, 2020):

Marking this for 21H1, taking triage off.

@DHowett-MSFT commented on GitHub (Apr 3, 2020): Marking this for 21H1, taking triage off.
Author
Owner
@zadjii-msft commented on GitHub (Dec 9, 2021): Possibly also related: * #4062 * #7581 * #5843
Author
Owner

@DHowett commented on GitHub (Dec 9, 2021):

image

I've got good news and bad news.

image
@DHowett commented on GitHub (Dec 9, 2021): <img width="230" alt="image" src="https://user-images.githubusercontent.com/189190/145469546-4b402456-ade6-4481-a81a-452b2da6d966.png"> I've got good news and bad news. <img width="630" alt="image" src="https://user-images.githubusercontent.com/189190/145469601-14dea9ce-b38c-4404-a9f6-78011f993fa4.png">
Author
Owner

@zadjii-msft commented on GitHub (Dec 9, 2021):

Arguably, whatever they were doing should still not crash, even if wmic itself is deprecated.

@zadjii-msft commented on GitHub (Dec 9, 2021): Arguably, whatever they were doing should still _not crash_, even if `wmic` itself is deprecated.
Author
Owner

@zadjii-msft commented on GitHub (Dec 13, 2021):

Meh, this one and #7581 are the same thing. That other thread's got a better non-wmic repro though, so I'm gonna use that one. Thanks!

/dup #7581

@zadjii-msft commented on GitHub (Dec 13, 2021): Meh, this one and #7581 are the same thing. That other thread's got a better non-`wmic` repro though, so I'm gonna use that one. Thanks! /dup #7581
Author
Owner

@ghost commented on GitHub (Dec 13, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Dec 13, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7205