scripts: free what a stopped script held (SCRIPTS.md slice 6, the teardown) #754

Open
opened 2026-11-13 12:39:37 +00:00 by orion · 0 comments
Collaborator

Context

The status line of docs/design/SCRIPTS.md (lines 4 and 17) says the sandbox's own heap of slice 6 is in and "the teardown that frees what a stopped script held is not built (section 6)". No open issue tracks the teardown. A host that loads and stops scripts repeatedly (the use the record is written for) leaks every stopped script's heap.

Source

  • Cleanup audit 2026-11 (#742), finding F11; the report is docs/project/2026-11-cleanup-audit.md.
  • docs/design/SCRIPTS.md status line and section 6.

Goal

Stopping a script releases everything its sandbox heap held, on every back end that runs scripts, and a test shows a host that loads and stops a script many times stays at a constant heap.

Design record point

docs/design/SCRIPTS.md section 6 (the heap of a sandbox and its teardown), section 9.

Acceptance criteria

  • Stopping a script frees its heap; resources the script held (section 6) are closed in the order the record gives
  • A test loads and stops a script in a loop and asserts the host's heap does not grow; it runs under the leak check of the gates
  • The status line of SCRIPTS.md says the teardown is built
  • The four gates and the fixpoint are green

Dependencies

None known; if section 6 waits on a gap of docs/design/RESOURCES.md (#99, #138), name it when the issue is refined.

Seed

None.

Size

One PR, one or two commits.

## Context The status line of `docs/design/SCRIPTS.md` (lines 4 and 17) says the sandbox's own heap of slice 6 is in and "the teardown that frees what a stopped script held is not built (section 6)". No open issue tracks the teardown. A host that loads and stops scripts repeatedly (the use the record is written for) leaks every stopped script's heap. ## Source - Cleanup audit 2026-11 (#742), finding F11; the report is `docs/project/2026-11-cleanup-audit.md`. - `docs/design/SCRIPTS.md` status line and section 6. ## Goal Stopping a script releases everything its sandbox heap held, on every back end that runs scripts, and a test shows a host that loads and stops a script many times stays at a constant heap. ## Design record point `docs/design/SCRIPTS.md` section 6 (the heap of a sandbox and its teardown), section 9. ## Acceptance criteria - [ ] Stopping a script frees its heap; resources the script held (section 6) are closed in the order the record gives - [ ] A test loads and stops a script in a loop and asserts the host's heap does not grow; it runs under the leak check of the gates - [ ] The status line of SCRIPTS.md says the teardown is built - [ ] The four gates and the fixpoint are green ## Dependencies None known; if section 6 waits on a gap of `docs/design/RESOURCES.md` (#99, #138), name it when the issue is refined. ## Seed None. ## Size One PR, one or two commits.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#754
No description provided.