-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Debugging without a network connection caused an exception #726
Comments
@GerhardRi Can you post code that causes this without modules? Otherwise, it is likely that the debugger you are using has native bindings and does not support io.js (yet). (See this list.) |
You can't use network stack without a network interface. |
It's just a local programm no network connections at all
I don't use an external debugger, just the build-in command line debugger |
When a program uses networking even for local communication it requires a network interface. When you start the debugger it tried to bind to an interface, then wait for connections from the target. loopback interface is a virtual network interface that allow local programs communicate using a network stack. |
As you can see ping the localhost and 127.0.0.1 works und doing the same with node.exe works too
|
I suspect that the problem might be related to the fact that 'node debug' starts two processes that communicate over port 5858. If there is no loopback network interface, then this might not work. |
ping.exe works, may be due to implementation exception when handling "localhost". When the tool recognize that the target is a localhost address it probably doesn't bother sending any icmp packets and assume success. (also see: "Martian packet") I wouldn't consider the ping tool as a control element in the question. |
I think we should be able to avoid the DNS resolve step by connecting to 127.0.0.1 instead of localhost. Does this patch help? diff --git a/lib/_debugger.js b/lib/_debugger.js
index 955080f..7881d72 100644
--- a/lib/_debugger.js
+++ b/lib/_debugger.js
@@ -1620,7 +1620,7 @@ Interface.prototype.trySpawn = function(cb) {
var self = this,
breakpoints = this.breakpoints || [],
port = exports.port,
- host = 'localhost',
+ host = '127.0.0.1',
childArgs = this.args;
this.killChild(); (You'll have to recompile the binary after applying the patch. Or you could hex-edit the existing binary, the strings are equally long. :-)) |
It works with a patched exe, i replaced all the 'localhost' with '127.0.0.1' |
@bnoordhuis wouldn't that patch cause issues on machines that only support IPv6? |
@cjihrig It would. But what machine supports IPv6 but not IPv4? It seems like an academic issue to me. |
I agree, but similar problems have come up before. nodejs/node-v0.x-archive#7637 |
Right, I can see how only IPv6 might be externally routable. But disallowing IPv4 localhost traffic? Seems implausible, it would break a lot of existing programs. |
Good point. This will never be an external connection. +1 from me then. If it does break for anyone, I'm sure they'll let us know. |
On machines without network connectivity, a DNS lookup for 'localhost' may fail. Connect to 127.0.0.1 to skip the host resolve step. Fixes: nodejs#726 PR-URL: nodejs#741 Reviewed-By: Colin Ihrig <[email protected]>
Fixed in 9dc9ec3. |
Without a network connection, no network adapters are installed, trying to debug caused an exception on my Win8.1 computer.
Steps to reproduce (io.js Versions 1.0.4 and 1.1.0):
After installing a Loopback Adapter it works fine:
The text was updated successfully, but these errors were encountered: