You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pwsh/powershell VT quirk causes conhost crash when resizing while alt buffer is being used #13037
fwiw I think I hit the same issue doing the following:
Run weechat in wsl2. Specifically, weechat 3.5 in ubuntu 22.04.1.
on the greeting screen (displays "WeeChat" in ascii art), resize Terminal until it crashes
It results in:
> Microsoft.Terminal.Control.dll!Microsoft::Terminal::Core::Terminal::Write(std::basic_string_view<wchar_t,std::char_traits<wchar_t>> stringView) Line 486 C++
Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::ControlCore::_connectionOutputHandler(const winrt::hstring & hstr) Line 1515 C++
[Inline Frame] Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler::{ctor}::__l1::<lambda_212_>::operator()(const winrt::hstring &) Line 507 C++
Microsoft.Terminal.Control.dll!winrt::impl::delegate<winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler,`winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler::implementation<winrt::Microsoft::Terminal::Control::implementation::ControlCore,void (__cdecl winrt::Microsoft::Terminal::Control::implementation::ControlCore::*)(winrt::hstring const &)>'::`1'::<lambda_212_>>::Invoke(void * output) Line 174 C++
[Inline Frame] TerminalConnection.dll!winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler::operator()(const winrt::param::hstring &) Line 451 C++
TerminalConnection.dll!winrt::impl::invoke<winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler,std::wstring>(const winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler & delegate, const std::wstring & <args_0>) Line 5762 C++
[Inline Frame] TerminalConnection.dll!winrt::event<winrt::Microsoft::Terminal::TerminalConnection::TerminalOutputHandler>::operator()(const std::wstring &) Line 5897 C++
TerminalConnection.dll!winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::_OutputThread() Line 659 C++
[Inline Frame] TerminalConnection.dll!winrt::Microsoft::Terminal::TerminalConnection::implementation::ConptyConnection::Start::__l3::<lambda_1>::operator()(void *) Line 362 C++
TerminalConnection.dll!_Closure_wrapper_1bfe9aa2_14::<lambda_invoker_cdecl>(void * __p1) Line 368 C++
kernel32.dll!BaseThreadInitThunk�() Unknown
ntdll.dll!RtlUserThreadStart�() Unknown
\x1b[?1049 appearing in the stringView seems suspicious.
This happens somewhat frequently while using WeeChat normally (i.e. not just looking at the greeting screen), so it's quite annoying, and has been occurring for a while.
I was going to take a crack at fixing this (at least locally), and I find that on my local build of current main branch (commit 1f19ed0), the crash does not occur. On the current release version (1.15.2875.0) I have installed, the crash still does occur.
What's the likelyhood this was actually fixed as opposed to being fixed by some difference in the build environment? What commit does 1.15.2875.0 relate to? There is no matching git tag.
Strangely I started getting a crash-on-resize again after running a round of Windows Update today (not sure if crash has same root cause though), and doing a clean rebuild of Terminal locally seems to have made the crash go away, again. I also updated VS2022 to current latest, so a lot of moving pieces, but... 🤨
Okay, coming back to this thread now that I'm back from leave and vacation.
I can't seem to repro this with weechat in main anymore. There've been some locking and lifetime changes over the last few months that might have fixed this. shuffle2 if you can't repro this on main anymore, then I suggest we punt this out to the backlog. The set of folks with the busted PsReadline that we still need to quirk for who are resizing their terminal while entering the alt buffer is gonna be samll and only shrinking. We can elevate from the backlog if we see live hits here, but I don't think there are any.
Actually heck, shuffle2's crash is a different thing anyways. The pwsh VT quirk only applies to conhost, and that stack is firmly in terminal code. I'm gonna punt and assume this was fixed. I vaguely recall some other resizing crash fixes, but 1.17 has been like, 4 months now.
Mike Griese (@zadjii-msft) I've just updated Windows and Terminal (from the store) again, and my crash (crash when resizing weechat output) still repros.
The versions are:
Terminal 1.18.2822.0
Windows 10.0.22621.2428
Although, getting the crash to occur isn't very deterministic. It seems to crash less frequently than before :/ Might need to try and compile with some debugging functionality and track it down eventually...unfortunately not much of a helpful update from me, here.
edit: actually, I'm probably hitting yet another crash, just happens to also be while doing my standard "resize weechat test".
The current crash which has happened a few times looks like this:
Activity
zadjii-msft commentedon Aug 1, 2022
note: We greatly reduced the number of places where this can trigger in #13352, but this quirk isn't entirely gone, so this bug persists.
shuffle2 commentedon Sep 15, 2022
fwiw I think I hit the same issue doing the following:
It results in:
\x1b[?1049appearing in thestringViewseems suspicious.This happens somewhat frequently while using WeeChat normally (i.e. not just looking at the greeting screen), so it's quite annoying, and has been occurring for a while.
I'm currently on Terminal 1.14.2282.0
I've just intsalled Microsoft.WindowsTerminal_Win11_1.15.2525.0_8wekyb3d8bbwe.msixbundle (hopefully that doesn't screw up the package on my system, which was previously just installed via Store...) and the crash is still present.
DHowett commentedon Sep 16, 2022
Whoa, thanks for this! A repro that doesn't involve the powershell quirk (which we just removed!) makes this much more important, too.
2 remaining items
shuffle2 commentedon Oct 16, 2022
I was going to take a crack at fixing this (at least locally), and I find that on my local build of current main branch (commit 1f19ed0), the crash does not occur. On the current release version (1.15.2875.0) I have installed, the crash still does occur.
What's the likelyhood this was actually fixed as opposed to being fixed by some difference in the build environment? What commit does 1.15.2875.0 relate to? There is no matching git tag.
shuffle2 commentedon Nov 13, 2022
Strangely I started getting a crash-on-resize again after running a round of Windows Update today (not sure if crash has same root cause though), and doing a clean rebuild of Terminal locally seems to have made the crash go away, again. I also updated VS2022 to current latest, so a lot of moving pieces, but... 🤨
zadjii-msft commentedon Jan 10, 2023
Okay, coming back to this thread now that I'm back from leave and vacation.
I can't seem to repro this with weechat in
mainanymore. There've been some locking and lifetime changes over the last few months that might have fixed this. shuffle2 if you can't repro this onmainanymore, then I suggest we punt this out to the backlog. The set of folks with the busted PsReadline that we still need to quirk for who are resizing their terminal while entering the alt buffer is gonna be samll and only shrinking. We can elevate from the backlog if we see live hits here, but I don't think there are any.Actually heck, shuffle2's crash is a different thing anyways. The pwsh VT quirk only applies to conhost, and that stack is firmly in terminal code. I'm gonna punt and assume this was fixed. I vaguely recall some other resizing crash fixes, but 1.17 has been like, 4 months now.
shuffle2 commentedon Oct 18, 2023
Mike Griese (@zadjii-msft) I've just updated Windows and Terminal (from the store) again, and my crash (crash when resizing weechat output) still repros.
The versions are:
Terminal 1.18.2822.0
Windows 10.0.22621.2428
Although, getting the crash to occur isn't very deterministic. It seems to crash less frequently than before :/ Might need to try and compile with some debugging functionality and track it down eventually...unfortunately not much of a helpful update from me, here.
edit: actually, I'm probably hitting yet another crash, just happens to also be while doing my standard "resize weechat test".
The current crash which has happened a few times looks like this:
!analyze output
faulting context
faulting code
Remove VT color quirk for PowerShell (microsoft#17666)
修复:缩窗口崩的是 conhost,不是我们的代码——传统宿主下不再使用备用屏幕