Broadcast Exit to multiple panes crash #22415

Closed
opened 2026-01-31 08:12:37 +00:00 by claunia · 5 comments
Owner

Originally created by @KruseCtrl on GitHub (Oct 17, 2024).

Originally assigned to: @carlos-zamora on GitHub.

Windows Terminal version

1.22.2702.0_x64

Windows build number

10.0.22631.4317

Other Software

No response

Steps to reproduce

  1. Open the Windows Terminal Preview
  2. Create a second pane.
  3. Toggle broadcast input to all panes (you should now be able to type in all panes)
  4. Press Ctrl + D or type "exit"
  5. the terminal crashes, even if you have other tabs open.

Expected Behavior

I'd expect it to exit out of the tab, so that if you have other tabs you can return to using them.

Actual Behavior

Upon exiting with multiple panes at the same time, it crashes and the program shuts down.

Originally created by @KruseCtrl on GitHub (Oct 17, 2024). Originally assigned to: @carlos-zamora on GitHub. ### Windows Terminal version 1.22.2702.0_x64 ### Windows build number 10.0.22631.4317 ### Other Software _No response_ ### Steps to reproduce 1. Open the Windows Terminal Preview 2. Create a second pane. 3. Toggle broadcast input to all panes (you should now be able to type in all panes) 4. Press Ctrl + D or type "exit" 5. the terminal crashes, even if you have other tabs open. ### Expected Behavior I'd expect it to exit out of the tab, so that if you have other tabs you can return to using them. ### Actual Behavior Upon exiting with multiple panes at the same time, it crashes and the program shuts down.
Author
Owner

@PriyanshSrivastava0305 commented on GitHub (Oct 17, 2024):

Can I have a look into it? @KruseCtrl

@PriyanshSrivastava0305 commented on GitHub (Oct 17, 2024): Can I have a look into it? @KruseCtrl
Author
Owner

@DHowett commented on GitHub (Oct 17, 2024):

@PriyanshSrivastava0305 I see that you've left this comment on multiple issues. I appreciate your enthusiasm! Just so you know: you do not need permission from the person who filed a bug--nor do you need to @-mention them--to start working on something.

Feel free to submit a pull request whenever it's ready. Otherwise, feel free to investigate bugs and leave the actual notes from your investigations in the comment history.

Otherwise, posting comments like this in every issue just generates spam mail for everyone to filter out.

@DHowett commented on GitHub (Oct 17, 2024): @PriyanshSrivastava0305 I see that you've left this comment on multiple issues. I appreciate your enthusiasm! Just so you know: you do not need permission from the person who filed a bug--nor do you need to `@`-mention them--to start working on something. Feel free to submit a pull request whenever it's ready. Otherwise, feel free to investigate bugs and leave the actual notes from your investigations in the comment history. Otherwise, posting comments like this in every issue just generates spam mail for everyone to filter out.
Author
Owner

@zadjii-msft commented on GitHub (Oct 24, 2024):

I wonder if this isn't from a similar root cause to #18049 (maybe #18086 too)

@zadjii-msft commented on GitHub (Oct 24, 2024): I wonder if this isn't from a similar root cause to #18049 (maybe #18086 too)
Author
Owner

@zadjii-msft commented on GitHub (Oct 24, 2024):

Interesting. I couldn't repro this with 1.21.2911.0. HOWEVER, I could repro it on 1.22.2912.0 with closeOnExit: never, and then pressing ^D to actually close the panes.

[0x0]   TerminalApp!std::_Ptr_base<Pane>::_Construct_from_weak   (Inline Function)   (Inline Function)   
[0x1]   TerminalApp!std::shared_ptr<Pane>::{ctor}+0x5   (Inline Function)   (Inline Function)   
[0x2]   TerminalApp!std::enable_shared_from_this<Pane>::shared_from_this+0x5   (Inline Function)   (Inline Function)   
[0x3]   TerminalApp!Pane::WalkTree<`Pane::BroadcastChar'::`2'::<lambda_1> >+0x32   0x5897b1de40   0x7fff94f18653   
[0x4]   TerminalApp!Pane::WalkTree<`Pane::BroadcastChar'::`2'::<lambda_1> >+0x1b3   0x5897b1def0   0x7fff94f3676b   
[0x5]   TerminalApp!Pane::BroadcastChar+0x3c   (Inline Function)   (Inline Function)   
[0x6]   TerminalApp!`winrt::TerminalApp::implementation::TerminalTab::_addBroadcastHandlers'::`2'::<lambda_2>::operator()<winrt::Windows::Foundation::IInspectable const &,winrt::Microsoft::Terminal::Control::CharSentEventArgs const &>+0x1fb   0x5897b1dfa0   0x7fff94f36561   
[0x7]   TerminalApp!winrt::impl::delegate<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>,`winrt::TerminalApp::implementation::TerminalTab::_addBroadcastHandlers'::`2'::<lambda_2> >::Invoke+0x21   0x5897b1e080   0x7fff948bfd94   
[0x8]   Microsoft_Terminal_Control!winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>::operator()+0x3b   (Inline Function)   (Inline Function)   
[0x9]   Microsoft_Terminal_Control!winrt::impl::invoke<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>,winrt::Microsoft::Terminal::Control::implementation::TermControl,winrt::Microsoft::Terminal::Control::CharSentEventArgs>+0xb4   0x5897b1e0b0   0x7fff948a043f   
[0xa]   Microsoft_Terminal_Control!winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs> >::operator()+0x49   (Inline Function)   (Inline Function)   
[0xb]   Microsoft_Terminal_Control!til::typed_event<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>::raise+0x49   (Inline Function)   (Inline Function)   
[0xc]   Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControl::_CharacterHandler+0x18f   0x5897b1e100   0x7fff948e862c   
[0xd]   Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControlT<winrt::Microsoft::Terminal::Control::implementation::TermControl>::Connect::__l5::<lambda_1>::operator()+0x4e   (Inline Function)   (Inline Function)   
[0xe]   Microsoft_Terminal_Control!winrt::impl::delegate<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::UI::Xaml::UIElement,winrt::Windows::UI::Xaml::Input::CharacterReceivedRoutedEventArgs>,`winrt::Microsoft::Terminal::Control::implementation::TermControlT<winrt::Microsoft::Terminal::Control::implementation::TermControl>::Connect'::`5'::<lambda_1> >::Invoke+0x6c   0x5897b1e1b0   0x7ff82268cc0f   
[0xf]   Windows_UI_Xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::ITypedEventHandler<Windows::UI::Xaml::UIElement *,Windows::UI::Xaml::Input::CharacterReceivedRoutedEventArgs *>,Windows::UI::Xaml::IUIElement,Windows::UI::Xaml::Input::ICharacterReceivedRoutedEventArgs>::Raise+0x11b   0x5897b1e200   0x7ff82268ca33   
[0x10]   Windows_UI_Xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::ITypedEventHandler<Windows::UI::Xaml::UIElement *,Windows::UI::Xaml::Input::CharacterReceivedRoutedEventArgs *>,Windows::UI::Xaml::IUIElement,Windows::UI::Xaml::Input::ICharacterReceivedRoutedEventArgs>::UntypedRaise+0x43   0x5897b1e2a0   0x7ff82231d637   
[0x11]   Windows_UI_Xaml!DirectUI::DependencyObject::FireEvent+0x8a   (Inline Function)   (Inline Function)   
[0x12]   Windows_UI_Xaml!DirectUI::DXamlCore::FireEvent+0x33a   (Inline Function)   (Inline Function)   



24475acba8/src/cascadia/TerminalApp/Pane.cpp (L3009-L3023)

24475acba8/src/cascadia/TerminalApp/Pane.h (L170-L184)

Looks like the pane probably got released while we were doing that WalkTree

@zadjii-msft commented on GitHub (Oct 24, 2024): Interesting. I couldn't repro this with 1.21.2911.0. HOWEVER, I could repro it on 1.22.2912.0 with `closeOnExit: never`, and then pressing `^D` to actually close the panes. ``` [0x0] TerminalApp!std::_Ptr_base<Pane>::_Construct_from_weak (Inline Function) (Inline Function) [0x1] TerminalApp!std::shared_ptr<Pane>::{ctor}+0x5 (Inline Function) (Inline Function) [0x2] TerminalApp!std::enable_shared_from_this<Pane>::shared_from_this+0x5 (Inline Function) (Inline Function) [0x3] TerminalApp!Pane::WalkTree<`Pane::BroadcastChar'::`2'::<lambda_1> >+0x32 0x5897b1de40 0x7fff94f18653 [0x4] TerminalApp!Pane::WalkTree<`Pane::BroadcastChar'::`2'::<lambda_1> >+0x1b3 0x5897b1def0 0x7fff94f3676b [0x5] TerminalApp!Pane::BroadcastChar+0x3c (Inline Function) (Inline Function) [0x6] TerminalApp!`winrt::TerminalApp::implementation::TerminalTab::_addBroadcastHandlers'::`2'::<lambda_2>::operator()<winrt::Windows::Foundation::IInspectable const &,winrt::Microsoft::Terminal::Control::CharSentEventArgs const &>+0x1fb 0x5897b1dfa0 0x7fff94f36561 [0x7] TerminalApp!winrt::impl::delegate<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>,`winrt::TerminalApp::implementation::TerminalTab::_addBroadcastHandlers'::`2'::<lambda_2> >::Invoke+0x21 0x5897b1e080 0x7fff948bfd94 [0x8] Microsoft_Terminal_Control!winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>::operator()+0x3b (Inline Function) (Inline Function) [0x9] Microsoft_Terminal_Control!winrt::impl::invoke<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>,winrt::Microsoft::Terminal::Control::implementation::TermControl,winrt::Microsoft::Terminal::Control::CharSentEventArgs>+0xb4 0x5897b1e0b0 0x7fff948a043f [0xa] Microsoft_Terminal_Control!winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs> >::operator()+0x49 (Inline Function) (Inline Function) [0xb] Microsoft_Terminal_Control!til::typed_event<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CharSentEventArgs>::raise+0x49 (Inline Function) (Inline Function) [0xc] Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControl::_CharacterHandler+0x18f 0x5897b1e100 0x7fff948e862c [0xd] Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControlT<winrt::Microsoft::Terminal::Control::implementation::TermControl>::Connect::__l5::<lambda_1>::operator()+0x4e (Inline Function) (Inline Function) [0xe] Microsoft_Terminal_Control!winrt::impl::delegate<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::UI::Xaml::UIElement,winrt::Windows::UI::Xaml::Input::CharacterReceivedRoutedEventArgs>,`winrt::Microsoft::Terminal::Control::implementation::TermControlT<winrt::Microsoft::Terminal::Control::implementation::TermControl>::Connect'::`5'::<lambda_1> >::Invoke+0x6c 0x5897b1e1b0 0x7ff82268cc0f [0xf] Windows_UI_Xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::ITypedEventHandler<Windows::UI::Xaml::UIElement *,Windows::UI::Xaml::Input::CharacterReceivedRoutedEventArgs *>,Windows::UI::Xaml::IUIElement,Windows::UI::Xaml::Input::ICharacterReceivedRoutedEventArgs>::Raise+0x11b 0x5897b1e200 0x7ff82268ca33 [0x10] Windows_UI_Xaml!DirectUI::CRoutedEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::ITypedEventHandler<Windows::UI::Xaml::UIElement *,Windows::UI::Xaml::Input::CharacterReceivedRoutedEventArgs *>,Windows::UI::Xaml::IUIElement,Windows::UI::Xaml::Input::ICharacterReceivedRoutedEventArgs>::UntypedRaise+0x43 0x5897b1e2a0 0x7ff82231d637 [0x11] Windows_UI_Xaml!DirectUI::DependencyObject::FireEvent+0x8a (Inline Function) (Inline Function) [0x12] Windows_UI_Xaml!DirectUI::DXamlCore::FireEvent+0x33a (Inline Function) (Inline Function) ``` https://github.com/microsoft/terminal/blob/24475acba845c2f2bf24d58245470d66ef487164/src/cascadia/TerminalApp/Pane.cpp#L3009-L3023 https://github.com/microsoft/terminal/blob/24475acba845c2f2bf24d58245470d66ef487164/src/cascadia/TerminalApp/Pane.h#L170-L184 Looks like the pane probably got released while we were doing that `WalkTree`
Author
Owner

@botscholar-scott commented on GitHub (Feb 7, 2025):

I'm also seeing this with 1.23.10353.0 (see https://youtu.be/K0vEnnK4dTA).

If it makes a difference we use Git Bash as our default terminal profile and in this example I have SSH'd to several EC2 that I render in terminal panes that I am broadcasting my exit to.

@botscholar-scott commented on GitHub (Feb 7, 2025): I'm also seeing this with 1.23.10353.0 (see https://youtu.be/K0vEnnK4dTA). If it makes a difference we use Git Bash as our default terminal profile and in this example I have SSH'd to several EC2 that I render in terminal panes that I am broadcasting my `exit` to.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22415