Skip to content

CHECK fails when using natives on node >= 8 #19891

@MarshallOfSound

Description

@MarshallOfSound
  • Version: >=8
  • Platform: All
  • Subsystem: internal/async_hooks

The Problem

require('natives').require('child_process')

Running the above code causes a CHECK to fail resulting in node crashing. This can not be caught user side and for Electron applications such as VS Code there is no way for them to catch a bad module doing this before the process crashes.

This CHECK should probably be done JS side and throw a JS land error if JS is the cause. We can leave the CHECK in for those doing bad things in native land but for the average joe just running JS we shouldn't being crashing on them IMO. Happy to put together a patch for this if folks are OK with the "throw an error in JS" strategy.

Disclaimer

I am aware that natives is questionable / not really support. However IMO the crash shouldn't happen. As I mention above it should throw a JS side error or just handle it 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions