Repository navigation
Replies: 3 comments 1 reply
|
This is a known failure, and the code in your title is not your command's exit status.
It is documented, and not new in 0.2.2-rc.1
The mechanism has been measured, in three producers
So the question that decides your case is not your Windows build but whether the process that creates the confined child owns a console. The
|
|
Update after further testing: this is not an environment/PATH problem. I fully restarted the machine and the DSH app. Excluded so far: stale PATH/environment in the app process, the PowerShell So the failure survives both a full reboot and a refreshed environment, which Happy to run diagnostics if you tell me what to collect. |
|
Here is exactly what to collect. Five steps; step 2 decides which of the others matter. 1 — the same command under
|
| # | field |
|---|---|
| 1 | full Windows build (22631.____) |
| 2 | pwsh --version |
| 3 | step 1: read-only exit code, and whether any output appeared |
| 4 | step 2: desktop vs console-hosted Web UI, per mode |
| 5 | step 3: four entries — mask + SID each — and which SID the merged grant names |
| 6 | step 4: GetConsoleWindow() of the mediator |
| 7 | step 5: cmd.exe /c "echo hi" exit code |
What I cannot supply
There is no Windows host here, so none of this is something I can run for you, and 22631 is outside every build it has been measured on (19044, 19045, 26200). Your machine is the only one that can produce these numbers. Send them and I will read them against what we already hold and name the producer your case belongs to — rather than ask you to collect it again.
Uh oh!
There was an error while loading. Please reload this page.
Question: is this a known regression on Windows, and is there a supported workaround short of escalating every single command to danger-full-access? If anyone else sees it, please add your Windows build — that would help pin it down.
What happens
With the file policy set to workspace-write, every shell command fails before producing any output. Exit code is 3221225794 = 0xC0000142 (STATUS_DLL_INIT_FAILED). The identical command with danger-full-access succeeds, so the interpreter is fine and the failure is in the confined spawn path.
Environment
OS: Windows 11 Pro 23H2, 10.0.22631, x64
Shell: PowerShell 7.6.6 (Core), C:\Program Files\PowerShell\7\pwsh.exe
DSH desktop: nightly channel, update feed
https://download.deepseek.com/dsh-desk/feeds/win-x64/
Workspace: D:\Deepseek Harness
File policy: workspace-write
Steps to reproduce
Open a session whose file policy is workspace-write.
Run any shell command, including a trivial one:
powershell
echo hi
Result: no stdout, no stderr, exit code 3221225794.
Control experiment
Same session, same command, one-shot escalation to danger-full-access:
powershell
$PSVersionTable.PSVersion.ToString(); "ok"
Prints 7.6.6 and ok, exit code 0. So pwsh, its DLLs and the environment are healthy; only the confined path fails.
Frequency and scope
100% reproducible. The first command of a session fails, and so does every subsequent one. Not transient, not command-specific, and nothing needs to be written to the workspace for it to happen.
Ruled out
PowerShell installation — the same binary works unconfined (7.6.6, standard MSI layout under C:\Program Files\PowerShell\7).
Global DLL injection — HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows has an empty AppInit_DLLs and LoadAppInit_DLLs = 0.
Crash in a specific module — no Application Error events (Event ID 1000) for pwsh.exe; the process exits rather than crashing with a faulting-module report.
Workspace contents — an empty command fails, so no project file is involved.
Hypothesis
0xC0000142 at startup is what the loader reports when a DLL's DllMain returns failure, which is almost always about the environment the process is created in, not about the executable. The confined spawn appears to hand the child a stdio/console state it cannot initialize — and the sandbox is documented to deny named pipes, which piped stdio needs. A child whose CRT cannot set up its console state fails inside DllMain, which surfaces as exactly this code, with no output and no Event Log entry.
Related items in the same area:
anywhere-labs/dsh-desktop PR #1575 "fix(desktop): give confined shells a console in Next and Beta"
discussions #1847 ("Workspace-write sandbox: external processes fail with 0xC0000142 on Windows 10 (build 19041)«) and #10046 (»DSH Windows sandbox 0xC0000142 — community fix recipe")
Impact
On Windows workspace-write is the default policy, and the shell is the only way to run git, builds, tests and Python. With this bug the whole toolchain is unusable: every command needs a manual escalation to danger-full-access, which defeats the purpose of the sandbox.
Suggested directions
Give the confined child a real console (CREATE_NEW_CONSOLE, or properly inherited console handles) instead of a detached/piped setup.
If valid std handles cannot be inherited under confinement, do not spawn with pipes in the first place — fall back to inherit/ignore stdio.
Fail loudly: when the confined spawn cannot initialize, put the reason into the tool result instead of surfacing a bare exit 0xC0000142, so users can tell a sandbox problem apart from their own command failing.
Happy to test a nightly build with a fix and report back.
All reactions