Replies: 2 comments
|
Following up on my own report — after posting I searched more thoroughly and found this is already well covered. Cross-referencing so the maintainers have everything in one place, and noting one extra data point. This is a duplicate — please treat these as the canonical threads
Apologies for the duplicate. My pre-post search did surface #1613 and #3466 but missed #5013 and #7292; had I found them I would have replied there instead of opening a new thread. Please feel free to close or merge this one. The one data point I think is worth addingThe reproduction in this report differs slightly from the others in which programs fail and how early:
If that holds, it suggests the restricted-token configuration is losing something the loader itself needs during DLL initialisation, not only something needed by a temp-writing startup path. That would put the failure one stage earlier than the temp-directory explanation in #5013, and would mean a fix scoped only to granting a scratch temp dir may not cover this host. I cannot verify that theory from here (no access to the runner sources on this machine), so I am flagging it as an observation rather than a claim. Environment where this reproduces
The file sandbox behaves correctly on this machine throughout (workspace writes OK, writes outside denied), which is what isolates this to the spawn path rather than a host problem. What would help mostIf the #5013 patch is waiting on maintainer sign-off, that decision is the actual blocker for this class of bugs — including the modal-dialog annoyance, which is the part that interrupts users. Happy to test a candidate build on this machine (Windows 10, |
|
Cross-link from #8142 — same Driving the sandbox package directly (
This matches your observation that the pwsh tool itself keeps working while other children fail: a child that shares an existing console lives, while any child that needs a new / hidden console ( Full report + minimal repro script: #8142 |
Uh oh!
There was an error while loading. Please reload this page.
Category: Bug report (posting under General since no Bugs category exists)
Environment:
@deepseek-ai/dsh0.1.5-rc.3, Windows 10 Pro NT 10.0.19045.0 x64, PowerShell 5.1.19041.7725, Node.js v24.20.0. File policyworkspace-write, approval policyask. Observed withdsh-sandbox-windows-acl/dsh-pwsh-sandbox/dsh-sandbox/dsh-sandbox-local/dsh-sandbox-policyall at0.1.5-rc.3.Symptom
Creating any child process from inside the sandbox pops a modal Windows error dialog:
cmd.exe,node.exe,powershell.exe,notepad.exe,ping.exe,whoami.exe,where.exe— all trigger it. The dialog is unrelated to the target program. Frequency is high, and dialogs stack up when several sessions run tasks concurrently.It does not break task execution. The dsh host process and the pwsh tool itself keep working; only child processes spawned from them fail.
0xC0000142=STATUS_DLL_INIT_FAILED.This behaviour predates 0.1.5-rc.3 — the reporter observed it for several days on earlier builds too, so it is not a regression introduced by this release, but it is 100% reproducible on it.
Reproduction
All three creation paths fail inside the sandbox:
Control: the identical commands succeed when run with widened permissions (
danger-full-access). The only variable is whether the call happens inside the restricted sandbox context.Start-Process cmd.exe-10737415020Start-Process notepad.exeStart-Process node.exeMinimal script
Actual output:
Every
FAILline corresponds to one Windows dialog.Related existing reports
This looks like another instance of a known family of Windows ACL-sandbox failures, so I'm filing it as an addition rather than a new class of bug:
sandbox-windows-acl), same root cause (restricted token viaCreateRestrictedToken), different failure code (fast-fail0xC0000409vs loader0xC0000142here).The distinguishing factor of this report is the UX symptom: #1613 crashes silently with an exit code, whereas here the failure surfaces as a modal Windows dialog that the user must dismiss, repeatedly. That is arguably worse for day-to-day use because it interrupts whatever else the user is doing, and it happens for every spawn rather than only for Cygwin/MSYS binaries.
Note the failure code differs from #1613 on the same host class: that report sees
0xC0000409(STATUS_STACK_BUFFER_OVERRUN, Cygwin's fast-fail after a deniedCreateFileMapping), while here plaincmd.exeandnode.exeboth fail with0xC0000142— the failure happens earlier, in loader DLL initialisation, before the program gets to run any of its own code. So the restricted token appears to break child creation at more than one stage, and which stage fails determines whether the user sees a silent exit code or a modal dialog.On this machine the only exception is the first-level
pwshhost itself, which the sandbox starts successfully; everything it then spawns dies with0xC0000142.Root cause
dsh-sandbox-windows-aclspawns children through a restricted token. This is visible in the shipped sources:Under that restricted token the Windows loader cannot complete DLL initialisation for the child, so
CreateProcessfails withSTATUS_DLL_INIT_FAILEDand the loader raises a modal error box.The key contradiction
The pwsh tool itself runs fine (it can read and write files, run internal cmdlets), yet any child process spawned from it fails. So the restricted token is sufficient to start the first-level host, but not to let that host spawn a second-level child.
That points at the nested-spawn path rather than first-level creation. Worth checking whether the sandbox re-applies restrictions when the spawning process is already itself restricted, or fails to carry over a privilege the loader needs.
This also explains why users perceive "it doesn't affect my work": the first layer of the tool chain is intact; only programs invoked from inside it are hit.
Scope check (eliminations)
To rule out a host problem rather than a sandbox problem:
kernel32/ntdll/user32/KernelBaseversions consistentSharedSection=1024,20480,768(Windows defaults)AppInit_DLLsinjectionLoadAppInit_DLLs=0__COMPAT_LAYERThe file sandbox behaving perfectly while only process creation fails is what isolates this to the spawn path. A full reboot changing nothing rules out pending-update or transient-state explanations.
Two defects
Functional — the restricted token is too restrictive for nested child creation. Suggest auditing the token handling on the nested-spawn path.
UX (the more important one) — even if the spawn should fail, it must not raise a modal Windows dialog. Windows raises it because the process is created with default error-mode settings. Please suppress it, e.g.:
or on the Node side create with
windowsHide: trueand avoidUseShellExecute, so the failure returns an error code for dsh to report itself instead of interrupting the user with a popup.Workaround
None needed for functionality. Blocking the popup would require weakening the sandbox (switching permission preset away from
workspace-write, or disablingpwsh-sandbox), which trades away the protection — not recommended as a fix, only as a last resort for the noise.AI assistance disclosure
This report, its reproduction, and the format were produced with assistance from DeepSeek (an AI coding agent running in DeepSeek Harness). The reporter is the machine owner who observed the dialogs and confirmed the behaviour predates 0.1.5-rc.3 on this machine.
All reactions