contour icon indicating copy to clipboard operation
contour copied to clipboard

Crash on Windows

Open ferdinandyb opened this issue 10 months ago • 1 comments
trafficstars

Contour Terminal version

Contour 0.6.1.7494

Installer source

GitHub: release page

Operating System

Win 11

Architecture

x86-64

Other Software

No response

Steps to reproduce

Start contour, start WSL, press ctrl+shift+t.

Expected Behavior

Probably nothing as I don't think I have a bind for this.

Actual Behavior

contour crashes

PS C:\Users\bferdinandy> [error] Ignoring TERM environment variable for child process.
[error] freetype: Failed to set LCD filter. unimplemented feature
[error] Ignoring TERM environment variable for child process.
Unhandled exception for event 6: KeyPress
?event@TerminalDisplay@display@contour@@UEAA_NPEAVQEvent@@@Z: Unhandled exception caught (class std::runtime_error). Could not create process. The directory name is invalid.

Additional notes

No response

ferdinandyb avatar Jan 22 '25 09:01 ferdinandyb

I'm able to reproduce the crash in a slightly different context when the profile's shell is set to use nushell instead of pwsh/powershell/cmd. Any attempt to create a new tab thereafter causes CreateProcess in https://github.com/contour-terminal/contour/blob/0aca498d250507ade3935f9139dc1ca814091fb8/src/vtpty/Process_win32.cpp#L224-L247 to throw the ERROR_DIRECTORY exception. When set to pwsh, opening new tabs even with a WSL session active does not cause a crash.

Stack trace from windbg:

 # Child-SP          RetAddr               Call Site
00 0000002d`b0365128 00007fff`fb7affbc     ntdll!RtlRaiseException
01 0000002d`b0365130 00007ffe`e05c9362     KERNELBASE!RaiseException+0x6c
02 0000002d`b0365210 00007ff7`9ca4ce88     VCRUNTIME140D!_CxxThrowException+0x132 [D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\throw.cpp @ 81] 
03 0000002d`b03652a0 00007ff7`9c6cfdd2     contour!vtpty::Process::start+0xad8 [contour\src\vtpty\Process_win32.cpp @ 251] 
04 0000002d`b0365d00 00007ff7`9c76e3e7     contour!contour::TerminalSession::start+0x142 [contour\src\contour\TerminalSession.cpp @ 313] 
05 0000002d`b0365e80 00007ff7`9c754fea     contour!contour::display::TerminalDisplay::setSession+0x807 [contour\src\contour\display\TerminalDisplay.cpp @ 311] 
06 0000002d`b03669f0 00007ff7`9c753034     contour!contour::TerminalSessionManager::activateSession+0x61a [contour\src\contour\TerminalSessionManager.cpp @ 134] 
07 0000002d`b0366e40 00007ff7`9c6d8d4c     contour!contour::TerminalSessionManager::createSession+0x24 [contour\src\contour\TerminalSessionManager.cpp @ 147] 
08 0000002d`b0366e70 00007ff7`9c723181     contour!contour::TerminalSession::operator()+0x1c [contour\src\contour\TerminalSession.cpp @ 1498] 
09 0000002d`b0366ea0 00007ff7`9c6fe3ee     contour!std::invoke<contour::TerminalSession &,contour::actions::CreateNewTab const &>+0x21 [C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\include\type_traits @ 1726] 

This also happens when opening a new window with ctrl+shift+n to create a new window when the config has spawn_new_process: false.

Would be happy to test changes if any, since I mainly use nushell at present.

Contour terminal version

0.6.1.7494 and 0.6.2-master-0aca498d.

Installer source

winget and built locally.

Operating System

Windows 11 23H2

Architecture

x86-64

ForceLightning avatar Apr 02 '25 08:04 ForceLightning