Skip to content

process._debugProcess results in an abort #32741

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
zyscoder opened this issue Apr 9, 2020 · 3 comments
Closed

process._debugProcess results in an abort #32741

zyscoder opened this issue Apr 9, 2020 · 3 comments
Labels
wontfix Issues that will not be fixed.

Comments

@zyscoder
Copy link

zyscoder commented Apr 9, 2020

  • Version:v12.16.0
  • Platform:Linux vul337 4.15.0-91-generic new design of error handling #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: process

What steps will reproduce the bug?

Directly run the following code snippet using node:

require('process')._debugProcess('str')

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

No. This potential bug can always be reproduced.

What is the expected behavior?

The argument to process._debugProcess should be an integer, but we passed a string value into it. The function should throw an exception or other similar error-reporting stuff rather than crash the whole nodejs process.

What do you see instead?

This is the stack dump produced during abort:

./node[16376]: ../src/node_process_methods.cc:325:void node::DebugProcess(const FunctionCallbackInfo<v8::Value> &): Assertion `args[0]->IsNumber()' failed.
 1: 0x13f9b30 node::Abort() [./node]
 2: 0x13f9709  [./node]
 3: 0x14f037e  [./node]
 4: 0x17b379c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [./node]
 5: 0x17b23d5  [./node]
 6: 0x17b1092  [./node]
 7: 0x2717a59  [./node]
[1]    16376 abort      ./node

Additional information

@mmarchini
Copy link
Contributor

mmarchini commented Apr 9, 2020

The abort is unexpected, and we could probably do some checking to avoid it. But it's worth noting that process._debugProcess is not public API and is not intended to be used outside of core.

Edit: just realized the abort is caused by a check. Not sure if we should throw instead, maybe if we turn this into a public API.

@himself65 himself65 added confirmed-bug Issues with confirmed bugs. and removed confirmed-bug Issues with confirmed bugs. labels Apr 12, 2020
@himself65
Copy link
Member

remove bug label because I think it's not a public API and will never update the usage of it.

@himself65
Copy link
Member

closing, comment see #32941 (comment)

@himself65 himself65 added the wontfix Issues that will not be fixed. label Apr 20, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
wontfix Issues that will not be fixed.
Projects
None yet
Development

No branches or pull requests

3 participants