Repository navigation
Replies: 3 comments
|
Thanks — the dump evidence is what this failure shape has been missing. Two corrections and three arms that would separate the causes, all from source. The two creators in the tree are not interchangeable.
Arms that separate the causes (same restricted token, same inherited handles in all three):
Honest boundary: we have no Windows machine; the above is this repository's source plus the account accumulated in prior reports of Same shape elsewhere: #9916 reports the same Related asset: Addendum — two of the three arms are already measured on this build. A measurement on Windows 10 22H2 build 19045, posted to
So on 19045 the conjunction is measured and either half recovers on its own. That makes your Where a third recovery could come from. Record the builds separately. On 19045 the conjunction is measured; #8721 reports 26200 failing even with |
|
Same failure here, and one data point the source analysis doesn't cover. Starting I reproduced this on the same machine, same install, changing only the launch path:
Not a contradiction of the analysis above - most likely the other half of the conjunction (keep-alive groups / default DACL trustee). Just noting that console inheritance alone was not sufficient in my case, so "start it from a console" is not a reliable workaround to hand out. Unrelated but probably saves someone an hour: even with full access enabled in Settings, the agent can still fail every command. There are two separate switches:
The session one is what actually governs the running session. If the agent reports permission errors or dies on This cost me several wrong hypotheses today. |
|
A genuine question rather than a data point, because I hit a wall the suggested arms don't address. The three arms (cmd.exe instead of pwsh, console-attached parent, keep-alive group) all require running something, and in How did you collect the DACL/keep-alive measurements you quoted (the
What I have so far, in case it's useful: starting |
Uh oh!
There was an error while loading. Please reload this page.
DSH Windows 沙箱导致 pwsh 无法启动(0xC0000142)问题报告
0.2.0-rc.2,channelnightly,win-x64)JSMAN/Jsman(机型单一账户).NET 10.0.13,CoreCLR 10.0.1326.46716)C:\Users\Heart\.dsh(DSH_PROFILE=desktop)1. 摘要
文件策略为
workspace-write时,DSH 的pwsh执行工具无法启动任何 PowerShell 进程:无 stdout、无 stderr,退出码3221225794(0xC0000142,STATUS_DLL_INIT_FAILED)。同一条命令在
danger-full-access下正常。因此故障不在 PowerShell 安装、系统文件或 PATH 解析,而在 DSH 创建沙箱子进程的实现。根因(已由决定性实验证明):沙箱 runner 使用
CreateProcessAsUserW+CreateRestrictedToken启动子进程。该组合产出的进程在加载 .NET 运行时之前即于 DLL 初始化阶段死亡;改用CreateProcessW+PROC_THREAD_ATTRIBUTE_TOKEN后完全正常。2. 现象(GUI 层复现)
| 命令 | 工作目录 | 输出 | 退出码
-- | -- | -- | -- | --
1 | $PSVersionTable.PSVersion.ToString(); ...; Get-Date | 默认 | 空 | 3221225794
2 | echo ok | 默认 | 空 | 3221225794
3 | "probe" | workspace | 空 | 3221225794
4 | $PSVersionTable...; (Get-Command pwsh).Source; ... | 默认 | 空 | 3221225794
5 | echo ok | 默认 | 空 | 3221225794
6 | "probe2" | C:\Users\Heart | 空 | 3221225794
7 | $PSVersionTable...; [Environment]::UserInteractive; echo ok | 默认 | 空 | 3221225794
现已修复并验证:启用
WerSvc、清零上述三个值、为pwsh.exe配置LocalDumps(DumpType=1、DumpCount=5、目录%LOCALAPPDATA%\CrashDumps、DontShowUI=1)。用[Environment]::FailFast()制造真实崩溃验证通过——退出码0x80131623,成功产出pwsh.exe.<pid>.dmp(6.3 MB)及Application Error 1000+.NET Runtime 1025事件。复现本问题请先确保 WER 可用,否则拿不到 dump。
7. 一处已纠正的误判(留档,避免重复踩坑)
早期曾将一条
System.AccessViolationException(at Nt.IsLogonSid(IntPtr),2026-10-17 12:50:27,.NET Runtime/1026)当作沙箱注入代码的罪证。该判断错误:
IsLogonSid实为本地诊断脚本acl-diagnosis/probe-restricted-token.ps1:90中的自定义 P/Invoke,崩溃原因是该探针在受限令牌(本就不含 logon SID)场景下解引用了GetSidSubAuthority返回的无效指针。与 DSH 实现无关,不应作为本 issue 的证据。8. 最小复现步骤
0.2.0-rc.2(win-x64 nightly)。workspace-write。echo ok。3221225794。danger-full-access,重复同一条命令 → 正常输出。9. 复现材料
acl-diagnosis/repro-cpau.ps1——CreateProcessAsUserW路径(失败)acl-diagnosis/probe-restricted-token.ps1——CreateProcessW+ 令牌属性(成功)acl-diagnosis/runner-extracted.js、runner.mjs—— 从app.asar提取的 runner 相关代码All reactions