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

Crash On Start (OpenConsole.exe) - FIXED IN 1.19.10821 #16794

Closed
Zeroes1 opened this issue Mar 1, 2024 · 33 comments
Closed

Crash On Start (OpenConsole.exe) - FIXED IN 1.19.10821 #16794

Zeroes1 opened this issue Mar 1, 2024 · 33 comments
Labels
Area-Quality Stability, Performance, Etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Resolution-External For issues that are outside this codebase Severity-Crash Crashes are real bad news.

Comments

@Zeroes1
Copy link

Zeroes1 commented Mar 1, 2024

Windows Terminal version

1.19.2402.26003-1.21.2402.29001

Windows build number

10.0.19045.4046 (22H2)

Other Software

No response

Steps to reproduce

Canary latest ok : terminal-1.21.491.0
terminal-1.21.501.0 - 💥crash on start
....
terminal-1.21.601.0 -💥crash on start

latest release / preview with 💥crash on start
terminal-1.19.10573.0
terminal-1.20.10572.0

previous release / preview - ok
terminal-1.19.10302.0
terminal-1.20.10303.0

💥crash💥 happens in OpenConsole.exe

FAILED_INSTRUCTION_ADDRESS:
OpenConsole!Microsoft::Console::Render::XtermEngine::StartPaint+610
00007ff6`b8c2d650 f34a0fb8043b    popcnt  rax,qword ptr [rbx+r15]

FAULTING_SOURCE_LINE:  C:\__w\1\s\src\renderer\vt\XtermEngine.cpp

FAULTING_SOURCE_FILE:  C:\__w\1\s\src\renderer\vt\XtermEngine.cpp

FAULTING_SOURCE_LINE_NUMBER:  87


MODULE_NAME: OpenConsole

IMAGE_NAME:  OpenConsole.exe

FAILURE_BUCKET_ID:  ILLEGAL_INSTRUCTION_c000001d_OpenConsole.exe!Microsoft::Console::Render::XtermEngine::StartPaint

reproduced 100%
version where work OpenConsole.exe popcnt used twiced
in latest version OpenConsole.exe used 4 times

If i change in new version WT, OpenConsole.exe to old version - WT work fine.

warning: my cpu is old: Intel Core 2 Duo E8400

OpenConsole.exe.7332.dmp

dump for terminal-1.19.10573.0

Expected Behavior

work fine...

Actual Behavior

trap on strart...

@Zeroes1 Zeroes1 added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 1, 2024
@ghost
Copy link

ghost commented Mar 1, 2024

I encountered the same issue.

My cpu is Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz 2.40 GHz.

This cpu did not support SSE 4.2 POPCNT so it may happen.

Windows Terminal version:1.19.10573.0

Below is WinDbg result.

0:002> !analyze -v
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************


KEY_VALUES_STRING: 1

    Key  : Analysis.CPU.mSec
    Value: 1514

    Key  : Analysis.Elapsed.mSec
    Value: 2368

    Key  : Analysis.IO.Other.Mb
    Value: 21

    Key  : Analysis.IO.Read.Mb
    Value: 89

    Key  : Analysis.IO.Write.Mb
    Value: 182

    Key  : Analysis.Init.CPU.mSec
    Value: 13546

    Key  : Analysis.Init.Elapsed.mSec
    Value: 798485

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 179

    Key  : Failure.Bucket
    Value: ILLEGAL_INSTRUCTION_c000001d_OpenConsole.exe!Microsoft::Console::Render::XtermEngine::StartPaint

    Key  : Failure.Hash
    Value: {47f4536c-a7a4-3f8f-fcb7-1fd4c54c55e7}

    Key  : Timeline.Process.Start.DeltaSec
    Value: 5

    Key  : WER.OS.Branch
    Value: vb_release

    Key  : WER.OS.Version
    Value: 10.0.19041.1

    Key  : WER.Process.Version
    Value: 1.19.2402.26003


FILE_IN_CAB:  OpenConsole.exe.5396.dmp

NTGLOBALFLAG:  0

PROCESS_BAM_CURRENT_THROTTLED: 0

PROCESS_BAM_PREVIOUS_THROTTLED: 0

APPLICATION_VERIFIER_FLAGS:  0

CONTEXT:  (.ecxr)
rax=0000000000000001 rbx=0000000000000000 rcx=00007ff7c2801e18
rdx=0000000000000000 rsi=0000000000000000 rdi=0000021b78e3e5d0
rip=00007ff7c270d650 rsp=0000007cecaffa30 rbp=0000007cecaffb30
 r8=00007ff7c2801e18  r9=0000000000000004 r10=00007ff7c26f0000
r11=0000000000000100 r12=0000000000000000 r13=0000000000000000
r14=00000000000001c8 r15=0000021b78e3ea00
iopl=0         nv up ei ng nz ac pe cy
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010293
OpenConsole!popcount64 [inlined in OpenConsole!Microsoft::Console::Render::XtermEngine::StartPaint+0x610]:
00007ff7`c270d650 f34a0fb8043b    popcnt  rax,qword ptr [rbx+r15] ds:0000021b`78e3ea00=????????????????
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ff7c270d650 (OpenConsole!popcount64)
   ExceptionCode: c000001d (Illegal instruction)
  ExceptionFlags: 00000000
NumberParameters: 0

PROCESS_NAME:  OpenConsole.exe

ERROR_CODE: (NTSTATUS) 0xc000001d - {   O}   s         s           s                 B

EXCEPTION_CODE_STR:  c000001d

STACK_TEXT:  
0000007c`ecaffa30 00007ff7`c26f719e     : 00000000`00000000 00000000`00000000 0000021b`78e0bfa0 00000000`00000000 : OpenConsole!Microsoft::Console::Render::XtermEngine::StartPaint+0x610
0000007c`ecaffb80 00007ff7`c26f6f1f     : 00000000`00000000 00000000`00000000 0000021b`78e0bf90 0000021b`78e0bf98 : OpenConsole!Microsoft::Console::Render::Renderer::_PaintFrameForEngine+0x1ee
0000007c`ecaffcc0 00007ff7`c271aa3b     : 0000021b`78e2d6b0 00000000`00000000 0000021b`78e0bfa8 0000021b`78e0bf98 : OpenConsole!Microsoft::Console::Render::Renderer::PaintFrame+0x4b
0000007c`ecaffcf0 00007fff`5c1b7344     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : OpenConsole!Microsoft::Console::Render::RenderThread::_ThreadProc+0x9b
0000007c`ecaffd20 00007fff`5ca826b1     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14
0000007c`ecaffd50 00000000`00000000     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21


STACK_COMMAND:  ~2s; .ecxr ; kb

FAILED_INSTRUCTION_ADDRESS: 
OpenConsole!Microsoft::Console::Render::XtermEngine::StartPaint+610 [C:\__w\1\s\src\renderer\vt\XtermEngine.cpp @ 87]
00007ff7`c270d650 f34a0fb8043b    popcnt  rax,qword ptr [rbx+r15]

FAULTING_SOURCE_LINE:  C:\__w\1\s\src\renderer\vt\XtermEngine.cpp

FAULTING_SOURCE_FILE:  C:\__w\1\s\src\renderer\vt\XtermEngine.cpp

FAULTING_SOURCE_LINE_NUMBER:  87

FAULTING_SOURCE_CODE:  
No source found for 'C:\__w\1\s\oss\libpopcnt\libpopcnt.h'


SYMBOL_NAME:  OpenConsole!Microsoft::Console::Render::XtermEngine::StartPaint+610

MODULE_NAME: OpenConsole

IMAGE_NAME:  OpenConsole.exe

FAILURE_BUCKET_ID:  ILLEGAL_INSTRUCTION_c000001d_OpenConsole.exe!Microsoft::Console::Render::XtermEngine::StartPaint

OS_VERSION:  10.0.19041.1

BUILDLAB_STR:  vb_release

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

IMAGE_VERSION:  1.19.2402.26003

FAILURE_ID_HASH:  {47f4536c-a7a4-3f8f-fcb7-1fd4c54c55e7}

Followup:     MachineOwner
---------

@lhecker
Copy link
Member

lhecker commented Mar 1, 2024

I may be misreading the disassembly incorrectly, but it seems to be correct to me:

image

Maybe the contents of the r12d register are incorrect? Here's the corresponding C++ code for the jump:

if (cpuid & bit_POPCNT)

It's very likely that this is a miscompilation. It'd be our 2nd one in these releases: #16742

@DLord420
Copy link

DLord420 commented Mar 3, 2024

Same issue here on Intel Q6600.

Please note that these old CPUs (such as Intel Core 2 family) does not support SSE 4.2 and therefore POPCNT instruction makes the apps to crash.

This is the same issue which was raised recently, causing various Windows Apps to crash on start, on older CPUs:
https://answers.microsoft.com/en-us/windows/forum/all/problem-solvedmicrosoft-photos-file-system-error/3bf0b7d0-4390-46f2-b948-a1e05d726e73

@tusharsnx
Copy link
Contributor

tusharsnx commented Mar 4, 2024

There is a report of miscompilation in VS 17.8.6 related to POPCNT [here]

Everything worked great before Visual Studio 17.8, so 17.7.7 was building perfectly fine apps this way. Starting with 17.8.* my binary started crashing with Illegal Instruction on older hardware, on this code part from the Concurrency library

Apparently it is fixed in VS 17.9.1

Fixed a bug where the libconcrt.lib used when static linking could contain an SSE 4.2 instruction that was illegal on older X64 systems.

@zadjii-msft zadjii-msft added the Resolution-External For issues that are outside this codebase label Mar 4, 2024
@DHowett DHowett pinned this issue Mar 4, 2024
@DHowett
Copy link
Member

DHowett commented Mar 4, 2024

We'll need to wait a little bit and re-issue new releases compiled with VS 17.9.1+ to test this hypothesis. Sorry for the delay.

@carlos-zamora carlos-zamora added Product-Conhost For issues in the Console codebase Area-Quality Stability, Performance, Etc. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 6, 2024
@carlos-zamora carlos-zamora added this to the Terminal v1.21 milestone Mar 6, 2024
@carlos-zamora carlos-zamora added Severity-Crash Crashes are real bad news. Priority-1 A description (P1) labels Mar 6, 2024
@fpefpe
Copy link

fpefpe commented Mar 7, 2024

I have the same issue ---- attached are the event log entry

As noted in previous posts, I to have an older laptop which might have the issue with the instruction being used

[
event-log-terminal-2024-03-07-09-55-41-544.zip

@oicu
Copy link

oicu commented Mar 8, 2024

I have the same issue.

CPU: Intel Mobile Core 2 Duo P8400
Support: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, EM64T, VT-x
System: Windows 11 Pro 22H2 22621.3155

Windows Terminal v1.19.10573.0: crash
Windows Terminal v1.18.10301.0: work fine.

@DivingDuck
Copy link

Same for me with the latest version of Windows Terminal and Windows Terminal Preview. Older versions before are doing fine.
CPU: Intel(R) Core(TM)2 Duo CPU, E8400.
Windows 10 Pro, Version 22H2, build 19045.4123, Windows Feature Experience Pack 1000.19054.1000.0

Event log: WindowsTerminalError.zip

@TemporaryAl
Copy link

Same here on Windows 10 Pro 22H2, 2x Intel(R) Xeon(R) CPU E5410 @ 2.33GHz

@CheapNightbot
Copy link

Windows Terminal v1.19.10573.0: crash
Windows Terminal v1.18.10301.0: work fine.

Processor: Pentium(R) Dual-Core CPU E5700 @ 3.00GHz 3.00 GHz
Installed RAM: 4.00 GB
System type: 64-bit operating system, x64-based processor
Edition: Windows 10 Pro
Version: 22H2
OS build: 19045.4123
Experience: Windows Feature Experience Pack 1000.19054.1000.0

Oh shiii-! Yes! The previous one was working fine and when I updated it to v1.19.10573.0, it started crashing with exit code 259. Like, no matter which profile (PowerShell, CMD, WSL) I open, it crashes immediately. And if me open, for example, PowerShell or CMD without Windows Terminal, it opens just fine.

And you know what's the fun part? I literally did system restore 2 times and reset Windows 1 time and finally format and re-install Windows thinking me did something wrong with my PC and finally got to know here that it's not just me... 〒▽〒 Why Microsoft ? ~(>_<。)\

image

@fpefpe
Copy link

fpefpe commented Mar 10, 2024

I am not sure if this is related --- but this issue just happens on my intel computer, my oher AMD computers work fine with the update

@DivingDuck
Copy link

Yes, it looks like it happens on older intel CPU's that are not supporting SSE 4.2. Same situation as happened a couple of weeks before with a couple of other updated apps from in the Microsoft store like Calculator. I have other PC's here that are not effected by this error and those all have SSE 4.2 support.

@CheapNightbot
Copy link

looks like it happens on older intel CPU's that are not supporting SSE 4.2.

woah~ makes sense. just like what they did with Windows 11 by introducing TPM 2.0...

So, any luck on it working again on older Intel CPUs in the next update or it will not be supporting at all ?

(⁠ ⁠;⁠∀⁠;⁠) hehe .. welp !

@DHowett
Copy link
Member

DHowett commented Mar 11, 2024

Put away your conspiracy theories, folks.

There's a compiler bug in MSVC 19.38 that results in the output of the CPUID instruction being misinterpreted, among other things. It turns out that the 1057x build series of Terminal was built with MSVC 19.38.

@CheapNightbot
Copy link

shocked-surprised.gif

@DivingDuck
Copy link

Put away your conspiracy theories, folks.

Not intended from my side. ;)
And good to know that you figure out what the root cause was.

@Zeroes1
Copy link
Author

Zeroes1 commented Mar 11, 2024

@DHowett latest canary for example: terminal-1.21.691.0 [10.03.2024] still crash, its normal?

@DHowett
Copy link
Member

DHowett commented Mar 11, 2024

Yes. I will inform you (and ask for help!) when our build agents have the new compiler. Then we can validate the Canary build and recompile the Stable and Preview builds if it works.

@ITmsdnet

This comment was marked as duplicate.

@DHowett
Copy link
Member

DHowett commented Mar 20, 2024

Hello!

We have a test build that we think will fix this.

Can somebody here test out one of these portable builds and report whether it works?

amd64
Microsoft.WindowsTerminalCanary_1.21.802.0_x64.zip

x86
Microsoft.WindowsTerminalCanary_1.21.802.0_x86.zip

@DivingDuck
Copy link

DivingDuck commented Mar 20, 2024

+1
This looks good for me. I tested the x64 version.

DHowett added a commit that referenced this issue Mar 20, 2024
DHowett added a commit that referenced this issue Mar 20, 2024
The 14.39 compiler seems pretty busted.

Refs #16794

(cherry picked from commit ff47e0c)
Service-Card-Id: 92139755
Service-Version: 1.20
DHowett added a commit that referenced this issue Mar 20, 2024
The 14.39 compiler seems pretty busted.

Refs #16794

(cherry picked from commit ff47e0c)
Service-Card-Id: 92139754
Service-Version: 1.19
@monocodezz
Copy link

Hello!

We have a test build that we think will fix this.

Can somebody here test out one of these portable builds and report whether it works?

amd64 Microsoft.WindowsTerminalCanary_1.21.802.0_x64.zip

x86 Microsoft.WindowsTerminalCanary_1.21.802.0_x86.zip

Yes, I can confirm that at least x64 build is nicely working on my venerable Core 2 Duo CPU :) Thanks!

@CheapNightbot
Copy link

Hello!

We have a test build that we think will fix this.

Can somebody here test out one of these portable builds and report whether it works?

amd64 Microsoft.WindowsTerminalCanary_1.21.802.0_x64.zip

x86 Microsoft.WindowsTerminalCanary_1.21.802.0_x86.zip

Hey, sorry, late here.. but tried Microsoft.WindowsTerminalCanary_1.21.802.0_x64.zip and it works as expected. Tried with all profiles and works fine.

@danielfdickinson
Copy link

Hello!

We have a test build that we think will fix this.

Can somebody here test out one of these portable builds and report whether it works?

amd64 Microsoft.WindowsTerminalCanary_1.21.802.0_x64.zip

x86 Microsoft.WindowsTerminalCanary_1.21.802.0_x86.zip

x86 version of WindowsTermianl.exe wt.exe and OpenConsole.exe all launch for me for both PowerShell and Command Prompt. This old computer was a fresh install just at the time the terminal broke, so there was no previous configuration.

Also confirmed that it launcehes on a new Lenovo ThinkPad (AMD Ryzen Pro 7) quite by accident (downloaded on that machine and forgot at first that was not the machine I on which the crash was happening).

Thank you for this!

@DHowett

This comment was marked as off-topic.

@rschrieken
Copy link

Hello!

We have a test build that we think will fix this.

Can somebody here test out one of these portable builds and report whether it works?

amd64 Microsoft.WindowsTerminalCanary_1.21.802.0_x64.zip

x86 Microsoft.WindowsTerminalCanary_1.21.802.0_x86.zip

Tested the amd64 and that version works on

Processor Intel(R) Core(TM)2 Extreme CPU X9650 @ 3.00GHz, 1995 Mhz, 4 Core(s), 4 Logical Processor(s)
OS Name Microsoft Windows 10 Pro
Version 10.0.19045 Build 19045

@DHowett
Copy link
Member

DHowett commented Mar 23, 2024

Thanks everyone for the help! We have some releases of 1.19 and 1.20 that are ready to go out via the Store to y'all. Publication is held up on some authentication problems, but you can expect these to come out on Monday March 25 (usually in the morning, US Central time).

@Zeroes1
Copy link
Author

Zeroes1 commented Mar 23, 2024

@DHowett
i check canary build
terminal-1.21.803.0
terminal-1.21.822.0

works OK, thanks!

@microwin7
Copy link

microwin7 commented Mar 24, 2024

Hello!

We have a test build that we think will fix this.

Can somebody here test out one of these portable builds and report whether it works?

amd64 Microsoft.WindowsTerminalCanary_1.21.802.0_x64.zip

x86 Microsoft.WindowsTerminalCanary_1.21.802.0_x86.zip

I have the same problem, this worked for me
My CPU: Intel Core 2 Duo

@fpefpe
Copy link

fpefpe commented Mar 24, 2024

I tests both the 64 as 32 bit version of the fix and they are working

@DHowett
Copy link
Member

DHowett commented Mar 25, 2024

Thank you all so much for testing this out. We just released 1.19.10821 and 1.20.10822, which have been built with the fix.

@DHowett DHowett closed this as completed Mar 25, 2024
@microsoft microsoft deleted a comment from ITmsdnet Mar 25, 2024
@DHowett DHowett changed the title CRASH ON START (in OpenConsole.exe) Crash On Start (OpenConsole.exe) - FIXED IN 1.19.10821 Mar 25, 2024
@CheapNightbot
Copy link

It's been 4 days and I haven't got the (Windows Terminal) update on/from Microsoft Store. ⊙⁠.⁠☉

@zadjii-msft
Copy link
Member

You can always just manually install from https://github.com/microsoft/terminal/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Quality Stability, Performance, Etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Resolution-External For issues that are outside this codebase Severity-Crash Crashes are real bad news.
Projects
None yet
Development

No branches or pull requests