Skip to content

Heavy use of TLSSocket + tls.connect crashes with SIGSEGV/SIGABRT #17475

Description

@pimterry

I've filed a repo with a full repro and details here: https://github.com/pimterry/node-tls-crash.

The specific code that's crashing is https://github.com/pimterry/node-tls-crash/blob/master/proxy.js

To summarize:

  • The repro is a minimal HTTPS-intercepting proxy: it uses new TLSSocket to handle incoming HTTP CONNECT sockets, uses tls.connect to create upstream connections, and pipes between the two.
  • Node aborts in under a minute with any serious web use (e.g. opening https://cnn.com in a browser a few times), with one of a variety of pointer errors, seemingly always in CRYPTO_free.
  • I can reproduce this in v8.9.1, v6.12.0 and v9.2.0
  • There's no native modules used here at all
  • I've attached two example core dumps as releases on the repro repo: https://github.com/pimterry/node-tls-crash/releases

I've pulled this out of a larger project, and tried to shrink the repro down as much as possible. It's pretty small and standalone, but still not tiny tiny, as I haven't found a way to reproduce this without a real working browser session. Happy to shrink it further if you have any suggestions for doing so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions