Skip to content
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

Node.js crashes using process.binding('uv').errname(positiveNumberOrNullValue) #44400

Closed
juanarbol opened this issue Aug 25, 2022 · 6 comments
Closed

Comments

@juanarbol
Copy link
Member

Version

v16.16.0 (also main branch at this moment)

Platform

Linux pop-os 5.19.0-76051900-generic #202207312230166078056622.04~9d60db1 SMP PREEMPT_DYNAMIC Thu A x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

By running code like this:

process.binding('uv').errname(0)
process.binding('uv').errname(1)
process.binding('uv').errname()

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

It should not crash, it could return undefined or do the libuv call

What do you see instead?

> process.binding('uv').errname(0)
node[742775]: ../src/uv.cc:75:void node::uv::ErrName(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(err) < (0)' failed.
 1: 0xb45090 node::Abort() [node]
 2: 0xb4510e  [node]
 3: 0xca433a node::uv::ErrName(v8::FunctionCallbackInfo<v8::Value> const&) [node]
 4: 0xe0b135  [node]
 5: 0xe0c79f v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
 6: 0x19d58b9  [node]
[1]    742775 IOT instruction (core dumped)  node

Additional information

I will provide the fix for this one. :gree

juanarbol added a commit to juanarbol/node that referenced this issue Aug 25, 2022
Return undefined from uv binding when no args are provided and do the libuv
call with any arg (if provided) to the binding.

Fixes: nodejs#44400
juanarbol added a commit to juanarbol/node that referenced this issue Aug 25, 2022
Return undefined from uv binding when no args are provided and do the
libuv call with any arg (if provided) to the binding.

Fixes: nodejs#44400
@theanarkh
Copy link
Contributor

theanarkh commented Aug 25, 2022

it seems this method is not used in Node.js source code.

@juanarbol
Copy link
Member Author

it seems this method is not used in Node.js source code.

It is not, but still reachable code in userland

@mscdex
Copy link
Contributor

mscdex commented Aug 25, 2022

It's also been (doc) deprecated since v10.9.0. Userland should not be relying on it.

If anything, I think we should start looking into making it a runtime deprecation now.

@juanarbol
Copy link
Member Author

It's also been (doc) deprecated since v10.9.0. Userland should not be relying on it.

If anything, I think we should start looking into making it a runtime deprecation now.

Like removing the pending deprecation flag?

@mscdex
Copy link
Contributor

mscdex commented Aug 26, 2022

@juanarbol Moving this outside of the conditional.

@juanarbol
Copy link
Member Author

This is an expected behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants