Skip to content

C# ResourceTable never frees entries #2056

Open

Description

@ludfjig

ResourceTable<T> in Runtime.cs adds an entry for every Give and Lend. Take and the end of a call set the entry's value to null but never remove the entry. A long-lived sandbox that passes resources across calls therefore grows by one entry per transfer, without limit.

Storing entries in a dictionary keyed by an increasing counter, and removing them on Take and at the end of a call, bounds the table to live entries. Handles are still never reused.

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

    S-needs-triageThe issue has not yet been reviewed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions