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

Always crashes with 0xc0000022 #9399

Closed
alancnet opened this issue Mar 6, 2021 · 9 comments
Closed

Always crashes with 0xc0000022 #9399

alancnet opened this issue Mar 6, 2021 · 9 comments
Assignees
Labels
Culprit-Centennial Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@alancnet
Copy link

alancnet commented Mar 6, 2021

Environment

Windows build number: Win32NT             10.0.19041.0 Microsoft Windows NT 10.0.19041.0
Windows Terminal version (if applicable): 1.6.10571.0

Any other software? WSL2

Steps to reproduce

  1. Install Windows Terminal
  2. Run Windows Terminal
    image

Expected behavior

I am expecting Windows Terminal to launch

Actual behavior

Windows Terminal always fails with

---------------------------
wt.exe - Application Error
---------------------------
The application was unable to start correctly (0xc0000022). Click OK to close the application. 
---------------------------
OK   
---------------------------

This happens regardless of the version I install, or the method I use to install, including Microsoft Store, chocolatey, or Github Releases.
I've also cleared out my user settings to no avail.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 6, 2021
@alancnet
Copy link
Author

alancnet commented Mar 6, 2021

I continued to investigate this issue, and used Process Explorer to see what was going on. I got Access Denied on vcruntime140.dll in C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.6.10571.0_x64__8wekyb3d8bbwe. Notably, Users lacked the execution privilege, so I took ownership of the file (previously owned by SYSTEM) and added Full Control to users. This resolved the issue.. but it is still a mystery to me how this could happen.

@zadjii-msft
Copy link
Member

@DHowett is this another one of those deployment issues we've been seeing?

Taking full permission of something in .../WindowsApps is probably not the best long term solution, but it's certainly weird that this was happening at all

@sungvzer
Copy link

sungvzer commented Mar 8, 2021

I'd like to add that, while running WindowsTerminal.exe or wt.exe from explorer results in a failure, running it from the Search Bar or an already running instance of wt or pwsh makes it run properly.

If I try to edit my permissions in Explorer, I get an "Access control entry is corrupt" kind of error.

@DHowett
Copy link
Member

DHowett commented Mar 11, 2021

This points to a permissions issue on WindowsApps itself -- not the Terminal directory.

Can you share the output of ...

icacls "\Program Files\WindowsApps"

?

From an admin shell, of course.

Mine are:

\Program Files\WindowsApps NT SERVICE\TrustedInstaller:(F)
                           NT SERVICE\TrustedInstaller:(OI)(CI)(IO)(F)
                           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)
                           NT AUTHORITY\SYSTEM:(F)
                           NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
                           BUILTIN\Administrators:(CI)(RX)
                           NT AUTHORITY\LOCAL SERVICE:(OI)(CI)(RX)
                           NT AUTHORITY\NETWORK SERVICE:(OI)(CI)(RX)
                           NT AUTHORITY\RESTRICTED:(OI)(CI)(RX)
                           BUILTIN\Users:(Rc,S,RD,REA,X,RA)

These are the expected permissions. Anything else somewhat contravenes expectations and can cause all sorts of app activation issues.

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 11, 2021
@sungvzer
Copy link

There it is!

C:\Program Files\WindowsApps\ NT SERVICE\TrustedInstaller:(F)
                              NT SERVICE\TrustedInstaller:(OI)(CI)(IO)(F)
                              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)(RX)
                              NT AUTHORITY\SYSTEM:(F)
                              NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
                              BUILTIN\Administrators:(CI)(RX)
                              NT AUTHORITY\SERVIZIO LOCALE:(OI)(CI)(RX)
                              NT AUTHORITY\SERVIZIO DI RETE:(OI)(CI)(RX)
                              NT AUTHORITY\RESTRIZIONI:(OI)(CI)(RX)
                              BUILTIN\Users:(Rc,S,RD,REA,X,RA)
                              SALVIO\Salvio:(OI)(CI)(F)

@DHowett
Copy link
Member

DHowett commented Mar 11, 2021

If you remove SALVIO\Salvio (icacls "C:\Program Files\WindowsApps" /remove SALVIO\Salvio), does the issue go away?

@DHowett
Copy link
Member

DHowett commented Mar 12, 2021

I'm gonna close this one out in favor of /dup #9452 -- please follow up there with the permissions discussion. I'd love to know if that helps, because if it does we can put together a FAQ document.

@ghost
Copy link

ghost commented Mar 12, 2021

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!

@ghost ghost closed this as completed Mar 12, 2021
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 12, 2021
@TheWhatis
Copy link

Just create file wte.bat (or other filename.bat), write in it
@echo off
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps\wt.exe
write a path your file in variable the PATH and open terminal from "run" with command wte (or other filename). ( Sorry for my English, I'm just starting to learn it XD )

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Culprit-Centennial Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

5 participants