You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Git Bash fails to start in an AppContainer (0xC0000142) #6576
Windows 11 24H2 (10.0.26200), and GitHub's windows-latest runner (Windows Server 2025)
Git for Windows 2.46.0 (MSYS runtime 3.4.10), and 2.56.1 on the runner
Details
Started inside an AppContainer, which sandboxes use to keep a program to the folders it's given, Git Bash exits before it runs anything:
C:\Program Files\Git\bin\bash.exe -c "echo hi"
On 2.46.0 it exits with 0xC0000142 (STATUS_DLL_INIT_FAILED) and prints nothing. Native programs work in the same container: cmd, PowerShell, git.exe (including git clone), and node.
It looks like three things in msys-2.0.dll:
Relocation. Windows always relocates images in an AppContainer process. The 3.4.10 DLL crashes as it starts. The runner's newer runtime survives the move, but fork then can't lay the child out like the parent.
Named objects. It creates \BaseNamedObjects\msys-2.0S5-<key>, and containers are refused there.
Permissions. With that out of the way, it fails with couldn't create signal pipe, Win32 error 5. Its pipes and shared memory get a security descriptor that grants Everyone, which an AppContainer process doesn't pass, so one confined msys process can't open what another made.
This looks like what git-for-windows/msys2-runtime#148 ("Support running MSYS in an AppContainer") and msys2/msys2-runtime#403 address. I'm filing this so people who hit the crash can find those PRs, and so it can be closed when a release has the fix.
Expected
Git Bash runs in an AppContainer, with what the container is given, as native programs do.
Activity