Repository navigation
Replies: 4 comments 1 reply
|
Independent corroboration: #8990 reports the same 0xC0000142 on a different machine. Comparing the two reports narrows the scope considerably:
So the failure is not tied to a specific Windows build, a specific install layout, or the presence/absence of PowerShell 7. Both reports independently converge on the same signature — any command, any PowerShell version, no stdout, no stderr, fixed exit code 3221225794. That is consistent with the runner-process-death hypothesis above, not with a confined command being denied. Upvoting both threads so they can be triaged together. |
|
I have the same error when using file deleting. Win10. |
|
Cross-referencing this with #9186 (posted today), which reports the same signature on a fourth build and narrows it to a single input — worth folding into the triage here, and one line of this report's framing needs correcting against the source. The runner is not the process that dies. This report's hypothesis is that the runner fails at load time, but the backend's failure contract says otherwise: the windows-acl runner reports every runner-side failure as The same rule explains the missing diagnostic. Because only exit 127 is admitted as a runner failure, On the root cause. #9186 varies one input — the restricting SID list — with I maintain a plugin that recognizes this family at the tool-result seam and emits a durable advisory ( |
|
我也遇到了 在win10上 [Windows] workspace-write 沙箱下所有受限子进程以 0xC0000142 (STATUS_DLL_INIT_FAILED) 失败环境
一、问题现象在文件权限预设为 特征:
模式相关性(实测):
即:只有 二、根本原因2.1 定位到的代码文件:
// 第 1293 行
setTokenDefaultDaclGrant(api, restrictedToken, this.tempWriteSidPtr ?? this.writeSidPtr ?? worldSid);
令牌构造见 884–897 行
2.2 逻辑缺陷
Windows 对被 WRITE_RESTRICTED 令牌访问的对象执行两次访问检查:
文档注释只考虑了 pass-2,遗漏了 pass-1。而
结果:进程无法访问自己在初始化期间创建的对象,加载器随即以 2.3 二分实验证据用
→ ACL 授予、Low 完整性标签、私有 temp 目录、TMP/TEMP 改写全部排除。 这些变量都不改变结果。 随后固定
唯一决定成败的变量:写入令牌默认 DACL 的 SID 是否为进程令牌自身持有的 SID。 补充:把同样的失败在 2.4 为什么
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows 11 (22631, x64), any command run through the
pwshtool while thefile policy is
workspace-writefails with exit code3221225794(
0xC0000142,STATUS_DLL_INIT_FAILED) and produces no stdout and no stderr.Even a pure no-op such as
exit 0fails.Switching the file policy to
danger-full-accessmakes the identical commandwork immediately, with no restart.
The failure is independent of the PowerShell version and of
PATH. Itreproduces on Windows PowerShell 5.1 and on PowerShell 7.6.6, including a run
where DSH's own shell had already resolved to
pwsh7.6.6.Environment
0.2.0-rc.2(desktop, win-x64, update channelnightly)10.0.22631.5335, AMD647.6.6Core (also reproduced on5.1.22621.4391)dsh-sandbox-local(Windows ACL restricted-tokenbackend), consumed via
dsh-pwsh-sandboxworkspace-writeReproduction
workspace-write.pwshtool, for exampleexit 0.3221225794.Current behavior
No stderr, no runner diagnostic, no
SandboxUnavailableError. The user onlyever sees a bare Windows NTSTATUS number.
Expected behavior
Either the command runs confined under
workspace-write, or the failure isclassified as a sandbox runner failure (per
runnerFailureRules) and surfacedas a sandbox-infrastructure error with a readable diagnostic — not a raw
0xC0000142.Evidence
All four runs below are on the same machine:
Row 3 is the decisive one. At that point DSH's own shell was already
PowerShell 7:
...and the confined call still died with
0xC0000142. So this is neither a"PowerShell not found, fell back to 5.1" problem nor a PATH staleness problem.
Separately: the Windows
Applicationevent log contains noApplication Erroror
Windows Error Reportingentry matchingc0000142,powershell,pwshorDeepSeek. Windows does not record this as an ordinary application crash.Root cause (hypothesis, not verified against source)
The
workspace-writepath is wrapped bydsh-sandbox-local's Windows ACLrestricted-token runner. A bare NTSTATUS exit code with zero stderr suggests
the runner process itself dies at load time (DLL initialization), rather than
the confined command being denied. A denial would be reported through
denialSignatures; a runner refusal throughrunnerFailureRules. Neitherreaches the user, so this failure path appears to bypass the documented
classification entirely.
The sandbox reference also notes that the Windows ACL runner already reports
partialenforcement with known gaps (hard links, unrestricted reads, and theAppContainer ACL boundary), so this backend may be the least-exercised one on
the affected configuration.
Workaround
Set the file policy to
danger-full-access. Thepwshtool then worksimmediately, with no restart.
Asks
Is the Windows ACL restricted-token runner expected to work on Windows 11
23H2 (build 22631) non-Enterprise / consumer SKUs? Are there prerequisites,
such as
SeAssignPrimaryTokenPrivilege, a specific UAC configuration,AppContainer support, or particular ACL/ownership on the workspace directory?
If the runner cannot start, please surface a classified runner-failure
diagnostic (or
SandboxUnavailableError) instead of a raw0xC0000142, sothat the failure is self-diagnosing.
If an environmental condition makes the ACL backend unusable, consider
falling back to
danger-full-accesswith a visible warning, rather thanfailing every command with no expla
All reactions