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 when exiting a tab with the debug tap #17432

Closed
j4james opened this issue Jun 13, 2024 · 4 comments
Closed

Crash when exiting a tab with the debug tap #17432

j4james opened this issue Jun 13, 2024 · 4 comments
Labels
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

Comments

@j4james
Copy link
Collaborator

j4james commented Jun 13, 2024

Windows Terminal version

Commit c52ba7d

Windows build number

10.0.19045.4412

Other Software

No response

Steps to reproduce

I've had this crash quite frequently in the preview build (I think possibly since v1.21), but I couldn't easily reproduce it. However, I've just discovered I can reproduce it consistently when running Windows Terminal from within the debugger with the following steps:

  1. Start Windows Terminal.
  2. Open a second tab with the debug tap.
  3. Type exit to close the second tab.

In both tabs I'm using a WSL bash shell, but I don't think that's relevant. The key thing is typing exit to close the tab rather than clicking on the close button.

Expected Behavior

The tab should close without crashing the terminal.

Actual Behavior

The terminal crashes with an exception in the Pane::_CloseChild method:

Unhandled exception thrown: read access violation.
this->_content.**m_ptr** was nullptr.

On this line:

const auto& control{ _content.GetRoot() };

And with the following stack trace:

>	TerminalApp.dll!Pane::_CloseChild(const bool closeFirst) Line 1433	C++
 	TerminalApp.dll!winrt::impl::delegate<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>,`Pane::_CloseChildRoutine'::`2'::<lambda_1>>::Invoke(void * sender, void * args) Line 883	C++
 	[External Code]	
 	WindowsTerminal.exe!WindowEmperor::_createNewWindowThread::__l2::<lambda_1>::operator()() Line 222	C++
 	[External Code]	

When I've had this crash in the preview build (assuming it was the same thing), it was usually when I was attempting to compile Windows Terminal and my system was low on memory. At the time I thought the lack of memory might have been a factor, but I suspect now that it might be a timing issue, and the low memory was just slowing the system enough for it to trigger the problem. Either way I'm hoping the trace above is enough for someone to figure out the cause.

I had also initially thought this might be the same bug as #17305, but my dev build has both PR #17333 and PR #17358 applied, so it can't be that.

@j4james j4james 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 Jun 13, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@j4james
Copy link
Collaborator Author

j4james commented Jun 14, 2024

Git bisect suggests this broke in commit ce0f8d6 (PR #17358). But that means the crashes I've been getting in the preview build are something else. Unless perhaps this commit isn't the real source of the bug, but just made it more likely to be triggered?

@PankajBhojwani
Copy link
Contributor

This should be fixed by #17450! Could you just double-check that?

@j4james
Copy link
Collaborator Author

j4james commented Jun 27, 2024

Yes, I can confirm that has fixed it. Thank you!

@j4james j4james closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

No branches or pull requests

2 participants