Skip to content

Assign process.debugPort with some value may results in an abort #38037

Closed
@zyscoder

Description

@zyscoder

What steps will reproduce the bug?

Setup a node instance,

» node

and run the following javascript code.

process.debugPort = 772189652114705600000
//value -1 works too: process.debugPort = -1
process.on('str',function(){})

Then the node instance occurs an abort.

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

This abort can always be triggered following the steps above.

What is the expected behavior?

Maybe some check for the assignement of the process.debugPort is necessary. If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.

What do you see instead?

» node
Welcome to Node.js v14.15.1.
Type ".help" for more information.
> 
> process.debugPort = 772189652114705600000
772189652114705600000
> processnode[209909]: ../src/node_options.h:33:int node::HostPort::port() const: Assertion `(port_) >= (0)' failed.
 1: 0xa03530 node::Abort() [node]
 2: 0xa035ae  [node]
 3: 0xa7a6b2  [node]
 4: 0xf427db v8::internal::Object::GetPropertyWithAccessor(v8::internal::LookupIterator*) [node]
 5: 0xf42398  [node]
 6: 0xee5c66 v8::internal::JSReceiver::GetOwnPropertyDescriptor(v8::internal::LookupIterator*, v8::internal::PropertyDescriptor*) [node]
 7: 0xee60e3 v8::internal::JSReceiver::GetOwnPropertyDescriptor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDescriptor*) [node]
 8: 0x107197b v8::internal::Runtime_GetOwnPropertyDescriptor(int, unsigned long*, v8::internal::Isolate*) [node]
 9: 0x13ff179  [node]
[1]    209909 abort (core dumped)  node                                                                                                                                                                                            

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.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