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

DNS lookupService fails with internal C error when given a string port number. #4837

Closed
rgrannell1 opened this issue Jan 24, 2016 · 1 comment
Labels
confirmed-bug Issues with confirmed bugs. dns Issues and PRs related to the dns subsystem.

Comments

@rgrannell1
Copy link

The DNS module's lookupService method throws an unwrapped C error when given a string for a port number. This isn't ideal; preferably a TypeError would be thrown instead, or the function would just parse the string to an integer.

The following error messages is given for the failing test cases shown below.

node: ../src/cares_wrap.cc:1098: void node::cares_wrap::GetNameInfo(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[2]->IsUint32()' failed.
Aborted

If I'm missing any important information, please tell me and I'll update this issue.

Environment:

  • Node v5.4.1
  • Npm 3.5.3
  • Linux 4.2.0-23-generic (Ubuntu)

Test-Case:

Failing Test Cases:

require('dns').lookupService('0.0.0.0', '0', (err, hostname, service) => {

})

require('dns').lookupService('127.0.0.1', '443', (err, hostname, service) => {

})

Control Test Cases:

Both these cases behave normally; they don't throw a C error.

require('dns').lookupService('0.0.0.0', 0, (err, hostname, service) => {

})

require('dns').lookupService('127.0.0.1', 443, (err, hostname, service) => {

})
@evanlucas
Copy link
Contributor

PR incoming to fix

@r-52 r-52 added confirmed-bug Issues with confirmed bugs. dns Issues and PRs related to the dns subsystem. labels Jan 24, 2016
evanlucas added a commit to evanlucas/node that referenced this issue Jan 25, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: nodejs#4837
PR-URL: nodejs#4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
rvagg pushed a commit that referenced this issue Jan 26, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: #4837
PR-URL: #4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
benjamingr pushed a commit to benjamingr/io.js that referenced this issue Jan 27, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: nodejs#4837
PR-URL: nodejs#4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
rvagg pushed a commit that referenced this issue Feb 8, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: #4837
PR-URL: #4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 17, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: #4837
PR-URL: #4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 18, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: #4837
PR-URL: #4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
MylesBorins pushed a commit that referenced this issue Mar 2, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: #4837
PR-URL: #4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
scovetta pushed a commit to scovetta/node that referenced this issue Apr 2, 2016
Previously, port was assumed to be a number and would cause an abort in
cares_wrap. This change throws a TypeError if port is not a number
before we actually hit C++.

Fixes: nodejs#4837
PR-URL: nodejs#4839
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Roman Klauke <[email protected]>
Reviewed-By: Brian White <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. dns Issues and PRs related to the dns subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants