Reports of native crashed using ConPTY under Windows 32-bit (Build 18362 and 18877) #626

Closed
opened 2026-01-30 21:57:19 +00:00 by claunia · 10 comments
Owner

Originally created by @Tyriar on GitHub (Apr 17, 2019).

Originally assigned to: @DHowett-MSFT on GitHub.

We got 2 reports of VS Code crashing by simply opening the terminal when ConPTY is enabled, switching to winpty fixes the issue: https://github.com/Microsoft/vscode/issues/72190

Originally created by @Tyriar on GitHub (Apr 17, 2019). Originally assigned to: @DHowett-MSFT on GitHub. We got 2 reports of VS Code crashing by simply opening the terminal when ConPTY is enabled, switching to winpty fixes the issue: https://github.com/Microsoft/vscode/issues/72190
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 17, 2019):

@Tyriar: There should be nothing conhost.exe (as the host of a pseudoterminal) can do to cause VS Code to crash. There may be a bug in conhost here, but VS Code should be more robust.

@DHowett-MSFT commented on GitHub (Apr 17, 2019): @Tyriar: There should be nothing conhost.exe (as the host of a pseudoterminal) can do to _cause VS Code to crash_. There may be a bug in conhost here, but VS Code should be more robust.
Author
Owner

@Tyriar commented on GitHub (Apr 17, 2019):

👍 something mustn't be handled right in node-pty https://github.com/Microsoft/node-pty/issues/277

@Tyriar commented on GitHub (Apr 17, 2019): 👍 something mustn't be handled right in node-pty https://github.com/Microsoft/node-pty/issues/277
Author
Owner

@oising commented on GitHub (Apr 18, 2019):

Make that three reports ;) It's crashing latest Code (x86) on Windows 10/18362 but the 64 bit version of Code isn't crashing. I'm assuming ConPTY is enabled by default on compatible versions of win10?

@oising commented on GitHub (Apr 18, 2019): Make that three reports ;) It's crashing latest Code (x86) on Windows 10/18362 but the 64 bit version of Code isn't crashing. I'm assuming ConPTY is enabled by default on compatible versions of win10?
Author
Owner

@Tyriar commented on GitHub (Apr 18, 2019):

I believe ConPTY is failing specifically on sysnative\cmd.exe as that should be the path used in WoW64 vscode: e4b5bccf93/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts (L121-L126)

@Tyriar commented on GitHub (Apr 18, 2019): I believe ConPTY is failing specifically on sysnative\cmd.exe as that should be the path used in WoW64 vscode: https://github.com/Microsoft/vscode/blob/e4b5bccf9364a0f678606d5bdfc18800854bf678/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts#L121-L126
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 18, 2019):

CreatePseudoConsole does not spawn your shell; that's your responsibility.

@DHowett-MSFT commented on GitHub (Apr 18, 2019): `CreatePseudoConsole` does not spawn your shell; that's your responsibility.
Author
Owner

@Tyriar commented on GitHub (Apr 18, 2019):

Closing in favor of https://github.com/Microsoft/node-pty/issues/277

@Tyriar commented on GitHub (Apr 18, 2019): Closing in favor of https://github.com/Microsoft/node-pty/issues/277
Author
Owner

@ghost commented on GitHub (May 29, 2019):

I think this issue should be reopened. I also saw problems when attempting to create C# bindings to the ConPTY APIs. When running in a 32-bit process (Visual Studio), I would get an exception back from the streams. It's been a while since I repro'd the issue, but if I remember correctly the error indicated that some stream internal to the conpty infrastructure had been unexpectedly closed.

@ghost commented on GitHub (May 29, 2019): I think this issue should be reopened. I also saw problems when attempting to create C# bindings to the ConPTY APIs. When running in a 32-bit process (Visual Studio), I would get an exception back from the streams. It's been a while since I repro'd the issue, but if I remember correctly the error indicated that some stream internal to the conpty infrastructure had been unexpectedly closed.
Author
Owner

@DHowett-MSFT commented on GitHub (May 30, 2019):

Mirroring internal discussion bits:

This is definitely concerning. We’ve tested conpty in WOW6432, WOA and CHPE (Windows on ARM) scenarios. If you are using the CreatePseudoConsole API, it will launch a conhost of the appropriate bitness.

When I say “appropriate bitness,” what I really mean is “the system’s native bitness.” Since conpty is a conhost feature, and conhost must match the bitness of its kernel driver, the pseudoconsole host will always be native. Fortunately, this is not unusual: launching a 32-bit console application on WOW64 also results in a mixed-bitness environment where conhost is different from the application.
All of these scenarios have been pretty well tested at this point.

Waiting for a repro. I'll reopen this bug with Needs-Repro until then.

@DHowett-MSFT commented on GitHub (May 30, 2019): Mirroring internal discussion bits: >This is definitely concerning. We’ve tested conpty in WOW6432, WOA and CHPE (Windows on ARM) scenarios. If you are using the CreatePseudoConsole API, it will launch a conhost of the appropriate bitness. >When I say “appropriate bitness,” what I really mean is “the system’s native bitness.” Since conpty is a conhost feature, and conhost must match the bitness of its kernel driver, the pseudoconsole host will always be native. Fortunately, this is not unusual: launching a 32-bit console application on WOW64 also results in a mixed-bitness environment where conhost is different from the application. >All of these scenarios have been pretty well tested at this point. Waiting for a repro. I'll reopen this bug with `Needs-Repro` until then.
Author
Owner

@DHowett-MSFT commented on GitHub (May 30, 2019):

This seems to have been partially the fault of node-pty for getting the calling conventions wrong and partially the vault of VS.

@DHowett-MSFT commented on GitHub (May 30, 2019): This seems to have been partially the fault of node-pty for [getting the calling conventions wrong](https://github.com/microsoft/node-pty/blob/master/src/win/conpty.cc#L36) and partially the vault of VS.
Author
Owner

@Tyriar commented on GitHub (May 30, 2019):

Thanks for looking into it 🙂

@Tyriar commented on GitHub (May 30, 2019): Thanks for looking into it 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#626