8000 docker: the compatibility check's output capture holds memory in proportion to its limit · Issue #416 · stratum-mining/sv2-ui · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

docker: the compatibility check's output capture holds memory in proportion to its limit #416

Open

Description

@GitGab19

Affected layers

  • Backend (server/): affected in tooling only. createBoundedOutputCapture in server/src/sv2-app-config-compatibility.ts keeps the start and the end of a check container's output within a character limit. The start it keeps is built from slices of the large string that holds the end, and each slice keeps that whole string alive, so many small writes after a large one hold many copies of it. The check runs only as npm run check:sv2-app-config, in CI on every PR and in the Docker release workflow; the running app never calls it.
  • Frontend (src/): not affected.
  • shared/: not affected.
  • The output comes from the selected sv2-apps images; nothing changes there.

Problem

Reproduced on main at ed7d84b with the Loupe test under Node 24: 512 KiB of output followed by 512 writes of 64 bytes, 544 KiB in all and within the capture's limit of about 1 MiB, exhausts a 128 MiB heap.

Impact

Only an sv2-apps image that prints such output can trigger it, and whoever controls that image already controls the mining containers of everyone who runs it. The effect is a compatibility check that crashes instead of reporting, failing the CI job or the release workflow. Loupe rates it low.

Expected outcome

  • The memory the output capture holds stays within a small multiple of its limit, whatever sizes the container writes in.
  • What the capture reports, the start and end of the output and the count of dropped characters, is unchanged.

Loupe findings

  • project-loupe/audit-sv2-ui#115: the start of the capture keeps slices of large output strings alive

Related issues and PRs

Activity

  1. added
    area:docker
    on Nov 17, 2026
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

    area:docker

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0