Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conhost crashes on SetConsoleWindowInfo #5843

Closed
Tracked by #7001
PhMajerus opened this issue May 11, 2020 · 14 comments
Closed
Tracked by #7001

conhost crashes on SetConsoleWindowInfo #5843

PhMajerus opened this issue May 11, 2020 · 14 comments
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Severity-Crash Crashes are real bad news.

Comments

@PhMajerus
Copy link

PhMajerus commented May 11, 2020

Found a new issue with conhost in Windows 10 20H1/2004 as pushed to the release preview ring.
Windows 10 build 19041.208 (up to date release preview ring) on a Surface Book 2 15", conhost.exe file version 10.0.19041.153.

The following code, compiled as CUI and launched from a cmd.exe prompt, will crash conhost, closing the window.

int main()
{
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SMALL_RECT srNewWinSize;
srNewWinSize.Top = 1;
srNewWinSize.Left = 1;
srNewWinSize.Right = 40;
srNewWinSize.Bottom = 20;
SetConsoleWindowInfo(hStdOut, TRUE, &srNewWinSize);
}

This used to work fine in previous versions of Windows 10, it seems to be a new issue with 20H1/2004.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 11, 2020
@DHowett-MSFT
Copy link
Contributor

hmm

image

This seems to be working properly for me. Digging more.

@DHowett-MSFT
Copy link
Contributor

I don't recall signing off on any conhost changes that would have given it a different build number than 19041.1 (!)

@DHowett-MSFT
Copy link
Contributor

Looks like it's working properly for me on .152/.208 as well.

If you can get a dump from conhost.exe when this happens, can you send it to me? E-mail's in my GitHub profile. 😄

@DHowett-MSFT DHowett-MSFT added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 11, 2020
@PhMajerus
Copy link
Author

Some system32 files are 19041.1 dated Dec 7, 2019, others are 19041.153 dated April 167 and May 12, 2020 (spotted container.dll and computecore.dll for example), some are even 19041.84 (werui.dll).

I've sent a crash dump by e-mail, let me know if you need any other.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 12, 2020
@DHowett-MSFT
Copy link
Contributor

Puzzlingly, it looks like we're falling over while trying to render an area that's absolutely on the screen. What other buffer parameters are you using? Starting width/height, buffer width/height?

@DHowett-MSFT DHowett-MSFT added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels May 13, 2020
@PhMajerus
Copy link
Author

PhMajerus commented May 13, 2020

I don't have any non-default setting in the registry, no UseDx in HKCU\Console.
Startup configuration is, I believe, the default for cmd.exe: Window size is 120×30, Buffer is 120×9001, CP is 437, and font is Consolas at size 16. Crash is the code shown above, compiled in VC++2017 x86 as conresize.exe.

Note I have EN-US as UI language, but also French and Japanese language packs installed (so console sees MS Gothic, Mincho, NSimSun, SimSun-ExtB, and installed the 4 Cascadia fonts systemwide, but the console is using Cascadia when the crash occurs.
Also, regional format is set to French (France), just in case you use APIs that rely on user's number formats somewhere (dot isn't the default decimal separator), and the system ANSI codepage is EN-US.

Shall I send a few other crash dumps to see if you can find other details?

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 13, 2020
@DHowett-MSFT
Copy link
Contributor

This is a real thinker. Sure, a couple more crash dumps might help, but... I'm utterly baffled. If that's the reproducer, and those are the conhosts, and it's just what you get when you run it from CMD this should be an absolute bullseye 😄

@DHowett-MSFT DHowett-MSFT added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels May 14, 2020
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label May 18, 2020
@ghost
Copy link

ghost commented May 18, 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 ghost closed this as completed May 21, 2020
@DHowett DHowett removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label May 21, 2020
@DHowett DHowett reopened this May 21, 2020
@DHowett
Copy link
Member

DHowett commented May 21, 2020

Gonna hold this one for a sec.

@PhMajerus
Copy link
Author

@DHowett Thanks, I'll get back to you with some more crash dumps once we're done with Build, Mixed Reality Dev Days and a day or two of sleep to recover 😅

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 21, 2020
@zadjii-msft
Copy link
Member

Hey I'm just gonna necro this thread now that we're all a good amount past Build. @DHowett did you ever get a chance to look at those crash dumps?

@zadjii-msft zadjii-msft added Product-Conhost For issues in the Console codebase Severity-Crash Crashes are real bad news. labels Jun 10, 2020
@PhMajerus
Copy link
Author

Sorry for the delay after Build, we had a lot of offline things to take care of.
The issue is still happening every single time with yesterday's update to Insider Release Preview build 19041.329.
Sending some more crashdumps to @DHowett-MSFT.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jun 10, 2020
@zadjii-msft zadjii-msft added Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. and removed Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 16, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 16, 2020
@zadjii-msft zadjii-msft added this to the 21H1 milestone Jun 16, 2020
@zadjii-msft zadjii-msft modified the milestones: Windows vNext, 22H1 Jan 4, 2022
@zadjii-msft zadjii-msft added the Priority-1 A description (P1) label Jan 4, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H1, Terminal v1.14 Feb 2, 2022
@zadjii-msft zadjii-msft added the zInbox-Bug Ignore me! label Mar 10, 2022
@zadjii-msft zadjii-msft removed the zInbox-Bug Ignore me! label Mar 24, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal v1.14, 22H2 Apr 28, 2022
@zadjii-msft zadjii-msft modified the milestones: 22H2, Terminal v1.18 Dec 5, 2022
@zadjii-msft
Copy link
Member

@PhMajerus You still seeing this/? I'm not seeing this anymore on a conhost built from main, so I'm assuming it was fixed in... the last two years.

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Dec 6, 2022
@PhMajerus
Copy link
Author

@zadjii-msft No, testing on Win11 22621.900 (Release Preview channel) doesn't crash anymore.
I'm not sure when it got fixed, but it might be a good idea to keep this scenario as a test to catch any regression with the console API.
Closing this now.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Severity-Crash Crashes are real bad news.
Projects
None yet
Development

No branches or pull requests

4 participants