microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.26k stars 8.27k forks source link

using `wt` alias results in silent crash (from explorer url bar, win+r, `wt` in start menu search) #17593

Closed kenblu24 closed 2 months ago

kenblu24 commented 2 months ago

Windows Terminal version

1.20.11781.0

Windows build number

10.0.19045.4651

Other Software

No response

Steps to reproduce

Reproduction is similar to https://superuser.com/questions/1699688/lauch-windows-terminal-via-alias-wt-exe-from-winr-causes-error-0xc0000022 except without any error popup. i.e.

  1. enter wt in any of the following:
    • explorer.exe URL bar
    • start menu search,
    • win+r Run dialog box
  2. press enter.
  3. Nothing.

Expected Behavior

Windows terminal opens with directory set to explorer location, or opens at all.

Actual Behavior

If entering in explorer, the address line changes to C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11781.0_x64__8wekyb3d8bbwe\wt.exe, and I get a crash dump in %~\AppData\Local\CrashDumps (38mb zip provided on request). No error dialogue is shown, and nothing else appears. I also see 1-2 entries in Event viewer:

Faulting application name: WindowsTerminal.exe, version: 1.20.2406.26001, time stamp: 0x667c7d41
Faulting module name: ucrtbase.dll, version: 10.0.19041.3636, time stamp: 0x81cf5d89
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process id: 0x7480
Faulting application start time: 0x01dadad4a9162b0b
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11781.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 61d998c4-e315-4118-969d-88eb1d327973
Faulting package full name: 
Faulting package-relative application ID: 

Report.wer:

WindowsTerminal.exe

Description
Faulting Application Path:   C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11781.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Creation Time:           7/20/2024 2:43:06 PM
Problem:             Stopped working
Status:              Report sent

Problem signature
Problem Event Name:           BEX64
Application Name:             WindowsTerminal.exe
Application Version:          1.20.2406.26001
Application Timestamp:        667c7d41
Fault Module Name:            ucrtbase.dll
Fault Module Version:         10.0.19041.3636
Fault Module Timestamp:       81cf5d89
Exception Offset:             000000000007286e
Exception Code:               c0000409
Exception Data:               0000000000000007

Extra information about the problem
Bucket ID:           b8fb0f969fbb2098bb359fddac21d6e8 (1960648987214206696)

I have tried using this tool (see SU post) to undo any WindowsApps permissions errors and have checked that I can no longer enumerate the contents of either WindowsApps folder from explorer, to no other visible effect.

github-actions[bot] commented 2 months ago

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.

kenblu24 commented 2 months ago

Thanks, botto. Here's some more information:

Terminal Preview was installed previously (with Terminal release uninstalled), had the same issue, and both have been uninstalled.

I also have Process Monitor, but am unsure how to share the log. However, I have noticed that a TON of CreateFile operations fail with NAME NOT FOUND. Most of these are items in the PATH but with Microsoft.dll, Microsoft.UI.dll, or Microsoft.UI.Xaml.XamlTypeInfo.dll appended to them image

C:\Users\kenbl>where wt
C:\Users\kenbl\AppData\Local\Microsoft\WindowsApps\wt.exe

C:\Users\kenbl>icacls "C:\Program Files\WindowsApps"
C:\Program Files\WindowsApps: Access is denied.
Successfully processed 0 files; Failed processing 1 files

C:\Users\kenbl>gsudo !!
Info: Command to run: icacls "C:\Program Files\WindowsApps"
C:\Program Files\WindowsApps NT AUTHORITY\RESTRICTED:(OI)(CI)(RX)
                             NT AUTHORITY\SYSTEM:(F)
                             NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
                             NT AUTHORITY\LOCAL SERVICE:(OI)(CI)(RX)
                             NT AUTHORITY\NETWORK SERVICE:(OI)(CI)(RX)
                             BUILTIN\Administrators:(CI)(RX)
                             BUILTIN\Administrators:(OI)(CI)(F)
                             BUILTIN\Users:(OI)(CI)(IO)(RX)
                             BUILTIN\Users:(Rc,S,RD,REA,X,RA)
                             NT SERVICE\TrustedInstaller:(OI)(CI)(IO)(F)
                             NT SERVICE\TrustedInstaller:(F)
                             APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(OI)(CI)(RX)
                             S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(RX)
                             S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(OI)(CI)(IO)(GR,GE)

Successfully processed 1 files; Failed processing 0 files

C:\Users\kenbl>gsudo icacls "C:\Users\kenbl\AppData\Local\Microsoft\WindowsApps"
C:\Users\kenbl\AppData\Local\Microsoft\WindowsApps NT AUTHORITY\SYSTEM:(OI)(CI)(F)
                                                   BUILTIN\Administrators:(OI)(CI)(F)
                                                   R4\kenbl:(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files
Eagle3386 commented 2 months ago

Confirming this, as I experience exactly the same issue.

Using Win+X menu or via wt within, e.g., Command Prompt, the Terminal app (non-preview, (re-) installed via Store) launches.

However, opening startmenu, typing wt & hitting Enter crashes Terminal, even if choosing Run as admin, without any dialog & silently producing dump files under %LocalAppData%\CrashDumps.

zadjii-msft commented 2 months ago

We're gonna de-dupe this with #17486 - can you go to that thread and share the output of cacls "C:\Program Files\WindowsApps" /S? That command gets us another bit of info that we don't get from icacls.

/dup #17486

Thanks!

microsoft-github-policy-service[bot] commented 2 months ago

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!