Skip to content

Segfaults with [await] using within node core #64230

Description

@Renegade334

js_explicit_resource_management is still a flagged feature in V8. We cannot depend on it in core.

Encountering [await] using in core will segfault if running in an environment without js_shipping features.

> out/Release/node --no-js-explicit-resource-management --eval 'diagnostics_channel.tracingChannel("foo").traceSync(() => {})'
[1]    160425 segmentation fault (core dumped)  out/Release/node --no-js-explicit-resource-management --eval

(This only applies to core, not the test suite.)

  • We should convert cases added by diagnostics_channel: add BoundedChannel and scopes #61680 from
    {
      using _ = blah;
      ...
    }
    to
    {
      const _ = blah;
      try {
        ...
      } finally {
        _[Symbol.dispose]();
      }
    }
    (cc @Qard)
  • I'll add an eslint rule to cover it.
  • Should we be doing a GHA CI run with --no-js-shipping in the global test options?

Activity

  1. Qard commented on Jul 1, 2026

    @Qard
    Member

    So we can expose the sync/async dispose methods on core types, but we can't actually use the using syntax in core yet? We could perhaps just rewrite those to manual invocations of the dispose methods for now, just to keep the semantics until the syntax is fully usable.

  2. Renegade334 commented on Jul 1, 2026

    @Renegade334
    MemberAuthor

    So we can expose the sync/async dispose methods on core types, but we can't actually use the using syntax in core yet?

    Pretty much!

  3. ayush23chaudhary commented on Jul 1, 2026

    @ayush23chaudhary
    Contributor

    Hi @Renegade334! I saw that PR #64231 adds the lint rule but the JS linter is currently failing, presumably because the existing using statements in lib/diagnostics_channel.js haven't been refactored yet. I would love to tackle this and convert them to try...finally blocks. Can I pick this up?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions