-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHECK fails when using natives
on node >= 8
#19891
Comments
I do not see anything wrong here as these are for internal use only. It would be better to instead ask about possible changes to public APIs/behavior to achieve whatever it is you're trying to do. |
I'm not trying to do anything, but a lot of users are 😄 Over on Electron we've been getting a lot of reports of this crash, we can trace it back but the fix / patch should probably come back to here. In an ideal world, |
IMO we should not start supporting use of node internals. We started hiding a lot of things for a reason. The moment we start making the changes suggested here, in my mind we begin implicitly support third party use of node internals. Either |
See #19786 (comment), #19786 (comment) and #19398 (comment). To summarize: known issue, will probably be fixed (@addaleax maintains Not much else to say so I'll close this out. |
@bnoordhuis @mscdex can this at least be reconsidered to be changed to a runtime error in JS instead of a native crash that brings down an entire process of node.js when hit? The reality is that there are tons of node module that can still trigger this and a simple |
@bpasero there is no JavaScript sitting between the call and the c++, and we want to make sure we're operating on the type we think we're operating on. bottom line these packages were always doing something bad and knowingly opted out of node's compatability |
@MarshallOfSound @bpasero It was created for the sake of doing unsupported things to Node.js internals. Once users do that, they are on their own (meaning that all stability/semver/error handling gurantees are void). That's written in the Anyone using |
I would argue that isn't the case, I'm 100% ok with these node internals throwing all kinds of errors when
The thing is, due to the way
This is a wonderful idea in theory, but people getting this crash probably don't have any idea |
You don't understand.
They only way where these could be fixed on case-by-case basis is on the |
@addaleax What do you think of emitting a deprecation warning at runtime from |
@ChALkeR Tbh, I’d like to wait until |
@addaleax Technically, |
I meant, when it’s no longer a pre-release. @phated has indicated that there is still a lot of work to be done around things like documentation, and I don’t really want to push users towards underdocumented software either… |
>=8
internal/async_hooks
The Problem
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 😄The text was updated successfully, but these errors were encountered: