Replies: 3 comments
|
Verified against master (47f9438) — your root cause is consistent with the sandbox's actual token configuration, and the diagnostic gap has a concrete fix site. Three additions: 1. The restricted token is exactly the shape that would break Cygwin's init
This is also a documented class of failure, not a novel one: the package's own "Known boundaries" note (index.ts:23-31) already lists console isolation — "CREATE_NO_WINDOW / CREATE_NEW_CONSOLE children die with STATUS_DLL_INIT_FAILED under the restriction". Cygwin's fast-fail abort and V8's fast-fail are the same family: restricted-token environments break programs that need init-time kernel objects/privileges, and those programs die via the Windows fast-fail channel (0xC0000409), which produces no output. 2. The bare exit code is the runner's verbatim propagation — the diagnostic gap has an exact fix site
3. The durable fix is image detection, not path-based exemptionsSuggested fix #1 (detect Cygwin/MSYS and skip wrapping) is right, but "skip wrapping" is the blunt end. A precise, cheap detector: scan the child PE's import table for Cross-threadThis is the platform family: #1420 (Windows arg quoting via |
|
The Cygwin half of this matches what we measured independently, and I can add signatures plus what actually survives. The node half I have not reproduced, so I am splitting them. On the Cygwin/MSYS side, this is now four independent sightings with two distinct signatures. Yours is A user later reported your signature on their own machine, and confirmed it still reproduces with an explicit This is not fixable at the plugin layer, and I do not think it is fixable at the config layer either. It is not the sandbox misconfigured, it is the MSYS runtime model and a restricted token being incompatible. That also explains something that looked like laziness across the ecosystem, which is that every Windows shell solution requires What survives is a shell with no POSIX emulation layer. busybox-w32's ash is a native Win32 implementation with no cygheap, so the initialization that gets denied never happens. We run a full send and read round trip through the restricted token on windows-latest as a required CI job, and the same job reproduces the MSYS death on the identical path so the contrast stays honest rather than asserted. One command reproduces it locally. SANDBOX_MODE=workspace-write node scripts/sandbox-smoke.mjsThe cost is real and worth stating. ash is not bash, so no arrays and no On node dying with The three tool failures you listed are probably not one bug. |
|
Shipped the diagnostic half (argszero's #2) — the durable Cygwin/MSYS interop fix (#1) is a separate, larger image-detection change.
One correction on the thread: the observed |
Uh oh!
There was an error while loading. Please reload this page.
Bug: Windows sandbox crashes Cygwin/MSYS tools and node — exit 3221225794 (0xC0000409)
Environment:
C:\Program Files\Git\usr\bin\grep.exe)Summary:
With the default
workspace-writesandbox on Windows, the ACL restricted-token runner crashes many real programs. Cygwin/MSYS executables (e.g. git'sgrep) andnodeboth die with exit code 3221225794 (= 0xC0000409, STATUS_STACK_BUFFER_OVERRUN — the Windows fast-fail path Cygwin and V8 use on fatal init errors). Simple commands likeechowork fine.Steps to reproduce:
dsh webon Windows (default permission modeworkspace-write).node --versionor a node script via thepwshtool.grep(tool-fs-search or shell).Observed behavior:
The
pwshtool running a node script returns empty output with a crash exit code:The filesystem search tool fails identically:
Running the Cygwin grep directly inside the sandboxed shell reveals the underlying failure:
(3221225794 = 0xC0000409 = STATUS_STACK_BUFFER_OVERRUN.)
Root cause analysis:
The Windows ACL sandbox runner (
packages/sandbox/sandbox-windows-acl) wraps every command with a restricted token viaCreateRestrictedToken. Cygwin/MSYS programs create a shared file mapping named after the user's SID at startup; under the restricted token thatCreateFileMappingcall is denied (Win32 error 5 / access denied), and Cygwin aborts immediately with a fast-fail exit code.node(V8) hits the same crash in this environment when running scripts that exercise similar paths. There is no error output because the crash happens before the program can print anything.Impact:
On Windows with the default sandbox, the
pwshshell tool and the file-search tool (grep) are effectively unusable for anything beyond trivial commands — a significant first-run blocker for Windows users.Workaround:
Set the permission mode to
danger-full-access(e.g.DSH_PERMISSION_MODE=danger-full-access, or a profile patch oversandbox-policy). The sandbox then skips process wrapping entirely and everything works.Suggested fixes (any one):
Win32 error 5) instead of a bare 0xC0000409 exit code with no output, so users can diagnose it.Happy to provide more logs or test a patch.
All reactions