Skip to content

Windows sandbox: scripts hang at a child process spawned with piped stdio (libuv#5178) #1165

Closed

Description

@tolgaergin

On Windows, a sandboxed lifecycle script hangs at the first child process it spawns with piped stdio. Found during the Windows 11 ARM64 verification pass (item 13).

What happens

  • The symptom: a script's child_process.spawnSync('whoami.exe', { stdio: 'pipe' }) never returns. The same call returns in 263 ms outside the sandbox.
    • The first run spun at about 100% CPU for over 6 minutes, with no child process, until lpm was killed.
    • This happens in every sandbox mode.
  • What works: spawns that give the child file handles, or stdio: 'ignore', return normally.
  • Who hits it: any approved lifecycle script that runs a tool and reads its output, such as through execSync, or spawnSync with its default stdio: 'pipe'.

Why

This is upstream, in libuv: libuv/libuv#5178.

  • For piped stdio, libuv creates a named pipe under the global \\?\pipe\uv\… name.
  • An AppContainer may only create pipes under \\.\pipe\LOCAL\, so the creation fails with ERROR_ACCESS_DENIED.
  • uv__pipe_server treats that error as a name collision and retries forever.

libuv/libuv#5181 fixes it: it uses the LOCAL\ prefix when TokenIsAppContainer. The fix shipped in libuv 1.53.0 (2026-09-24).

No Node release bundles the fix yet (checked 2026-11-12):

  • Node main, v26.x (26.13.1) and v24.x bundle libuv 1.52.1, and v25.x bundles 1.51.0.
  • nodejs/node#66282, which updates to 1.53.0, is open.

What lpm can do meanwhile

lpm can't change the pipe names libuv picks, and an unelevated lpm can't open the global pipe namespace to an AppContainer. Mitigations to decide on:

  1. Say what is happening: when a sandboxed script's Node (process.versions.uv) is older than 1.53.0, say so if the script runs long or fails, and point to the upstream fix.
  2. Check it ahead of time: a lpm doctor check that reports the Node on PATH as affected.
  3. Document it: the Windows sandbox docs, with the workaround of running the affected package's scripts unsandboxed after review.

Once a Node release bundles libuv 1.53.0, the check can name the first fixed version.

Activity

  1. added
    bug
    on Nov 12, 2026
  2. tolgaergin commented on Nov 20, 2026

    @tolgaergin
    ContributorAuthor

    lpm's part shipped in #1208 (9d91dcc), released in v0.87.0. Before scripts start, a sandboxed run on Windows asks the host's node which libuv it bundles. If that libuv is older than 1.53.0, lpm warns once, and names this hang as a possible cause when a script runs out of time. The probe never runs a node the project controls, and it has a two-second limit.

    The fix itself is upstream: libuv 1.53.0 (libuv/libuv#5181). As of 2026-11-20 no Node release bundles it. v26.13.1 and the v27 alphas ship libuv 1.52.1, and nodejs/node#66282 is still open. Once a Node release bundles 1.53.0, the warning applies only to older Node versions, and lpm needs no further change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions