vkey assertion failure 2, with dragging tabs #15004

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

Originally created by @Rosefield on GitHub (Aug 28, 2021).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version (or Windows build number)

dev/main @e4c5e8bd

Other Software

No response

Steps to reproduce

I am not able to trigger this consistently despite my best efforts, but it has happened 4 times so far when attempting to drag a tab the application crashes on a vkey || scanCode assertion. I have had this happen both on windows with only one tab, and windows with more than one tab. When it does happen it occurs pretty soon after the drag starts, not on drop. I don't believe there was any keypress besides a left mouse down, and attempting to mash my keyboard while dragging did not result in any crashes.

My settings are unchanged after the last fix, but just in case https://gist.github.com/Rosefield/789cc469f1b9e605ada014add66eed9d

This also happened on my save window layout branch, which was branched off of main from this commit: 68294f863d but when it happened there it was the old assert removed in the last fix (70d44c84c8 (diff-ac308dd6d23797c02f8be4591060500c2474856a7c3f483ac5cff219b3fc16a2L720))

Expected Behavior

no crash

Actual Behavior

Potentially 2 bugs

  1. Assertion failure right after start drag on tab

image

stack trace in https://github.com/microsoft/terminal/issues/11076#issuecomment-907695937

2. I managed to get a stack trace once at least. although this doesn't seem to be the error I initially saw? Can trigger consistently by holding shift while dragging a tab.
KernelBase.dll!00007ff81cbfbd3e()
combase.dll!00007ff81f07d76a()
Windows.UI.Xaml.dll!00007ff8057f01c2()
Windows.UI.Xaml.dll!00007ff8054a16e9()
Windows.UI.Xaml.dll!00007ff8054a370b()
Windows.UI.Xaml.dll!00007ff8054a35fc()
CoreMessaging.dll!00007ff819cd53db()
CoreMessaging.dll!00007ff819cfc85b()
CoreMessaging.dll!00007ff819cd996b()
CoreMessaging.dll!00007ff819cd8e26()
CoreMessaging.dll!00007ff819cd7061()
CoreMessaging.dll!00007ff819cd6e83()
user32.dll!00007ff81eaae858()
user32.dll!00007ff81eaae3dc()
user32.dll!00007ff81eac0bc3()
ntdll.dll!00007ff81f2d0c54()
win32u.dll!00007ff81cac1064()
user32.dll!00007ff81eaaa5c3()
user32.dll!00007ff81eaaa523()
combase.dll!00007ff81eeee71b()
combase.dll!00007ff81eeee685()
combase.dll!00007ff81eeecec1()
combase.dll!00007ff81eeecbbb()
combase.dll!00007ff81eec4956()
combase.dll!00007ff81eeed143()
combase.dll!00007ff81ef0099b()
combase.dll!00007ff81eeec494()
combase.dll!00007ff81ef3996e()
rpcrt4.dll!00007ff81d46fd84()
combase.dll!00007ff81ef35438()
combase.dll!00007ff81efab8e2()
DataExchange.dll!00007ffff5208d42()
Windows.UI.Xaml.dll!00007ff805ab5be9()
Windows.UI.Xaml.dll!00007ff805cbd6c4()
Microsoft.Terminal.Control.dll!winrt::impl::consume_Windows_UI_Xaml_IDragEventArgs2<winrt::Windows::UI::Xaml::DragEventArgs>::DataView() Line 1034
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.h(1034)
Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_DragOverHandler(const winrt::Windows::Foundation::IInspectable & __formal, const winrt::Windows::UI::Xaml::DragEventArgs & e) Line 2292
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(2292)
[External Code]
Microsoft.Terminal.Control.dll!winrt::impl::delegate<winrt::Windows::UI::Xaml::DragEventHandler,void <lambda>(const winrt::Windows::Foundation::IInspectable &, const winrt::Windows::UI::Xaml::DragEventArgs &)>::Invoke(void * sender, void * e) Line 4616
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.h(4616)
[External Code]
WindowsTerminal.exe!wWinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, wchar_t * __formal, int __formal) Line 201
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\WindowsTerminal\main.cpp(201)
[External Code]
Originally created by @Rosefield on GitHub (Aug 28, 2021). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version (or Windows build number) dev/main @e4c5e8bd ### Other Software _No response_ ### Steps to reproduce I am not able to trigger this consistently despite my best efforts, but it has happened 4 times so far when attempting to drag a tab the application crashes on a vkey || scanCode assertion. I have had this happen both on windows with only one tab, and windows with more than one tab. When it does happen it occurs pretty soon after the drag starts, not on drop. I don't believe there was any keypress besides a left mouse down, and attempting to mash my keyboard while dragging did not result in any crashes. My settings are unchanged after the last fix, but just in case https://gist.github.com/Rosefield/789cc469f1b9e605ada014add66eed9d This also happened on my save window layout branch, which was branched off of main from this commit: https://github.com/microsoft/terminal/commit/68294f863d2adfafd6937324486b499fea73b8ab but when it happened there it was the old assert removed in the last fix (https://github.com/microsoft/terminal/commit/70d44c84c84ec22f2c56fce72c617fea7f9816f4#diff-ac308dd6d23797c02f8be4591060500c2474856a7c3f483ac5cff219b3fc16a2L720) ### Expected Behavior no crash ### Actual Behavior Potentially 2 bugs 1. Assertion failure right after start drag on tab ![image](https://user-images.githubusercontent.com/6185249/131231416-cb6cd6d6-6d6c-4cf5-858a-05f25c5271f1.png) stack trace in https://github.com/microsoft/terminal/issues/11076#issuecomment-907695937 <details> <summary>2. I managed to get a stack trace once at least. although this doesn't seem to be the error I initially saw? Can trigger consistently by holding shift while dragging a tab. </summary> ``` KernelBase.dll!00007ff81cbfbd3e() combase.dll!00007ff81f07d76a() Windows.UI.Xaml.dll!00007ff8057f01c2() Windows.UI.Xaml.dll!00007ff8054a16e9() Windows.UI.Xaml.dll!00007ff8054a370b() Windows.UI.Xaml.dll!00007ff8054a35fc() CoreMessaging.dll!00007ff819cd53db() CoreMessaging.dll!00007ff819cfc85b() CoreMessaging.dll!00007ff819cd996b() CoreMessaging.dll!00007ff819cd8e26() CoreMessaging.dll!00007ff819cd7061() CoreMessaging.dll!00007ff819cd6e83() user32.dll!00007ff81eaae858() user32.dll!00007ff81eaae3dc() user32.dll!00007ff81eac0bc3() ntdll.dll!00007ff81f2d0c54() win32u.dll!00007ff81cac1064() user32.dll!00007ff81eaaa5c3() user32.dll!00007ff81eaaa523() combase.dll!00007ff81eeee71b() combase.dll!00007ff81eeee685() combase.dll!00007ff81eeecec1() combase.dll!00007ff81eeecbbb() combase.dll!00007ff81eec4956() combase.dll!00007ff81eeed143() combase.dll!00007ff81ef0099b() combase.dll!00007ff81eeec494() combase.dll!00007ff81ef3996e() rpcrt4.dll!00007ff81d46fd84() combase.dll!00007ff81ef35438() combase.dll!00007ff81efab8e2() DataExchange.dll!00007ffff5208d42() Windows.UI.Xaml.dll!00007ff805ab5be9() Windows.UI.Xaml.dll!00007ff805cbd6c4() Microsoft.Terminal.Control.dll!winrt::impl::consume_Windows_UI_Xaml_IDragEventArgs2<winrt::Windows::UI::Xaml::DragEventArgs>::DataView() Line 1034 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.h(1034) Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_DragOverHandler(const winrt::Windows::Foundation::IInspectable & __formal, const winrt::Windows::UI::Xaml::DragEventArgs & e) Line 2292 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(2292) [External Code] Microsoft.Terminal.Control.dll!winrt::impl::delegate<winrt::Windows::UI::Xaml::DragEventHandler,void <lambda>(const winrt::Windows::Foundation::IInspectable &, const winrt::Windows::UI::Xaml::DragEventArgs &)>::Invoke(void * sender, void * e) Line 4616 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.h(4616) [External Code] WindowsTerminal.exe!wWinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, wchar_t * __formal, int __formal) Line 201 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\WindowsTerminal\main.cpp(201) [External Code] ``` </details>
Author
Owner

@lhecker commented on GitHub (Aug 28, 2021):

Are you running this under a debugger? If so: Are you perhaps able to screenshot or copy/paste a stack trace of the assertion failure after clicking "Retry"?

@lhecker commented on GitHub (Aug 28, 2021): Are you running this under a debugger? If so: Are you perhaps able to screenshot or copy/paste a stack trace of the assertion failure after clicking "Retry"?
Author
Owner

@Rosefield commented on GitHub (Aug 28, 2021):

I managed to get it to fail just in time for you :) Unfortunately it was on the window that wasn't being actively debugged.

@Rosefield commented on GitHub (Aug 28, 2021): I managed to get it to fail just in time for you :) Unfortunately it was on the window that wasn't being actively debugged.
Author
Owner

@lhecker commented on GitHub (Aug 28, 2021):

Huh that stack trace is curious... DataView() is a function we don't control...
Is the crash perhaps occurring on a background thread and the debugger erroneously focused on the main thread instead?
I'll try to replicate this issue myself next week.

@lhecker commented on GitHub (Aug 28, 2021): Huh that stack trace is curious... `DataView()` is a function we don't control... Is the crash perhaps occurring on a background thread and the debugger erroneously focused on the main thread instead? I'll try to replicate this issue myself next week.
Author
Owner

@lhecker commented on GitHub (Aug 28, 2021):

Oh you added that it was on a different window. Gotcha 👍

@lhecker commented on GitHub (Aug 28, 2021): Oh you added that it was on a different window. Gotcha 👍
Author
Owner

@Rosefield commented on GitHub (Aug 28, 2021):

So, I may have found a second bug in my attempts to discover the first one? Now I no longer get the assertion failure, just that above exception. This one I can reproduce somewhat consistently by holding down shift and just dragging around a tab wildly. For reference, when debugging this is what I get. Perhaps I don't have the right exception handling settings?

Unhandled exception at 0x00007FF81CBFBD3E (KernelBase.dll) in WindowsTerminal.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x000001A5C7175AB0, 0x0000000000000002).
@Rosefield commented on GitHub (Aug 28, 2021): So, I may have found a second bug in my attempts to discover the first one? Now I no longer get the assertion failure, just that above exception. This one I can reproduce somewhat consistently by holding down shift and just dragging around a tab wildly. For reference, when debugging this is what I get. Perhaps I don't have the right exception handling settings? ``` Unhandled exception at 0x00007FF81CBFBD3E (KernelBase.dll) in WindowsTerminal.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x000001A5C7175AB0, 0x0000000000000002). ```
Author
Owner

@Rosefield commented on GitHub (Aug 28, 2021):

Managed to trigger the original issue again. It happened as soon as I picked up the tab to start dragging. After spending like 10 minutes since I foolishly checked download symbols from the symbol server not realizing it would be multiple gigabytes, I present you with this stack trace

I also captured a memory dump if it helps, you can download here: https://rosefield.org/files/WindowsTerminal.dmp Let me know if you need anything else.

ucrtbased.dll!common_assert_to_message_box<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 388
	at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(388)
ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 424
	at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(424)
ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 444
	at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(444)
Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::KeyChord::KeyChord(const winrt::Windows::System::VirtualKeyModifiers modifiers, int vkey, int scanCode) Line 42
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\KeyChord.cpp(42)
Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::KeyChord::KeyChord(bool ctrl, bool alt, bool shift, bool win, int vkey, int scanCode) Line 25
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\KeyChord.cpp(25)
[External Code]
Microsoft.Terminal.Control.dll!winrt::make<winrt::Microsoft::Terminal::Control::implementation::KeyChord,bool &,bool &,bool &,bool &,int &,int &>(bool & <args_0>, bool & <args_1>, bool & <args_2>, bool & <args_3>, int & <args_4>, int & <args_5>) Line 7703
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\base.h(7703)
[External Code]
Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_TryHandleKeyBinding(const unsigned short vkey, const unsigned short scanCode, Microsoft::Terminal::Core::ControlKeyStates modifiers) Line 947
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(947)
Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_KeyHandler(const winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs & e, const bool keyDown) Line 897
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(897)
Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_KeyDownHandler(const winrt::Windows::Foundation::IInspectable & __formal, const winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs & e) Line 826
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(826)
[External Code]
Microsoft.Terminal.Control.dll!winrt::impl::delegate<winrt::Windows::UI::Xaml::Input::KeyEventHandler,void <lambda>(const winrt::Windows::Foundation::IInspectable &, const winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs &)>::Invoke(void * sender, void * e) Line 1395
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.Input.h(1395)
[External Code]
WindowsTerminal.exe!wWinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, wchar_t * __formal, int __formal) Line 201
	at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\WindowsTerminal\main.cpp(201)
[External Code]
@Rosefield commented on GitHub (Aug 28, 2021): Managed to trigger the original issue again. It happened as soon as I picked up the tab to start dragging. After spending like 10 minutes since I foolishly checked download symbols from the symbol server not realizing it would be multiple gigabytes, I present you with this stack trace I also captured a memory dump if it helps, you can download here: https://rosefield.org/files/WindowsTerminal.dmp Let me know if you need anything else. ``` ucrtbased.dll!common_assert_to_message_box<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 388 at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(388) ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 424 at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(424) ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 444 at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(444) Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::KeyChord::KeyChord(const winrt::Windows::System::VirtualKeyModifiers modifiers, int vkey, int scanCode) Line 42 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\KeyChord.cpp(42) Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::KeyChord::KeyChord(bool ctrl, bool alt, bool shift, bool win, int vkey, int scanCode) Line 25 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\KeyChord.cpp(25) [External Code] Microsoft.Terminal.Control.dll!winrt::make<winrt::Microsoft::Terminal::Control::implementation::KeyChord,bool &,bool &,bool &,bool &,int &,int &>(bool & <args_0>, bool & <args_1>, bool & <args_2>, bool & <args_3>, int & <args_4>, int & <args_5>) Line 7703 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\base.h(7703) [External Code] Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_TryHandleKeyBinding(const unsigned short vkey, const unsigned short scanCode, Microsoft::Terminal::Core::ControlKeyStates modifiers) Line 947 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(947) Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_KeyHandler(const winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs & e, const bool keyDown) Line 897 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(897) Microsoft.Terminal.Control.dll!winrt::Microsoft::Terminal::Control::implementation::TermControl::_KeyDownHandler(const winrt::Windows::Foundation::IInspectable & __formal, const winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs & e) Line 826 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\TermControl.cpp(826) [External Code] Microsoft.Terminal.Control.dll!winrt::impl::delegate<winrt::Windows::UI::Xaml::Input::KeyEventHandler,void <lambda>(const winrt::Windows::Foundation::IInspectable &, const winrt::Windows::UI::Xaml::Input::KeyRoutedEventArgs &)>::Invoke(void * sender, void * e) Line 1395 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.Input.h(1395) [External Code] WindowsTerminal.exe!wWinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, wchar_t * __formal, int __formal) Line 201 at C:\Users\Schuyler\Desktop\Development\terminal\src\cascadia\WindowsTerminal\main.cpp(201) [External Code] ```
Author
Owner

@ghost commented on GitHub (Oct 4, 2021):

:tada:This issue was addressed in #11306, which has now been successfully released as Windows Terminal v1.10.2714.0.🎉

Handy links:

@ghost commented on GitHub (Oct 4, 2021): :tada:This issue was addressed in #11306, which has now been successfully released as `Windows Terminal v1.10.2714.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.10.2714.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Oct 4, 2021):

:tada:This issue was addressed in #11306, which has now been successfully released as Windows Terminal Preview v1.11.2731.0.🎉

Handy links:

@ghost commented on GitHub (Oct 4, 2021): :tada:This issue was addressed in #11306, which has now been successfully released as `Windows Terminal Preview v1.11.2731.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.11.2731.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15004