Skip to content

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

@juanarbol

Description

@juanarbol

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

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