Skip to content

Release every persistent V8 handle before isolate teardown #851

Closed

Description

@wieslawsoltes

Problem

The exact Linux package gate crashes in many otherwise independent V8 test executables during runtime destruction. GDB from run 35511487622 identifies a stale persistent handle released after its isolate:

v8::internal::GlobalHandles::NodeSpace<...>::Release
webscene_native::v8_dom_runtime::implementation::~implementation()
v8_dom_runtime::~v8_dom_runtime()
webscene_engine::run_core

implementation::~implementation() disposes its owned isolate inside the destructor body, but several v8::Global owners remain populated and are therefore destroyed later with the C++ object. The generated meter/output/progress element templates are direct omissions. Active drag state, outbound drag state, and the discrete wheel animation can also retain persistent handles across teardown.

Proposed fix

  • Release every direct generated DOM template before isolate disposal.
  • Reset optional/owned interaction state that contains v8::Global handles before isolate disposal.
  • Keep async worker shutdown and handle release ordered before Isolate::Dispose().
  • Audit every direct and nested persistent handle owner in runtime state against the destructor.

Acceptance

  • Focused native V8 runtime tests exit normally on Linux without GlobalHandles::NodeSpace::Release faults.
  • The exact package gate has no teardown SIGSEGV across independent V8 executables.
  • Shared-isolate and owned-isolate lifetimes both retain their existing order.
  • No additional steady-state work or memory is introduced.

Evidence

Parent tracker: #687

Activity

  1. added
    bug
    vscode-oss/planned
    on Sep 20, 2026
  2. added
    vscode-oss/merged
    and removed
    vscode-oss/planned
    on Sep 20, 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

    bugvscode-oss/merged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions