nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨

Home Page:https://nodejs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assertion when attaching the Chrome dev tools

vladima opened this issue · comments

Version: v.6.4.0
Platform: Windows10 64 bit
Repro:

  • Run (script can be moved to the separate file, repro uses inline version only for brevity):
node --inspect -e "while(1);"
  • Open url that will be printed to start debugging.

Expected:

  • Chrome dev tools are opened without any errors

Actual:
node process shuts down the message:

C:\Program Files\nodejs\node.EXE: src\inspector_socket.cc:569: Assertion `(inspector->http_parsing_state) == (nullptr)' failed.

Works for me with master (on Linux) so this probably just needs back-ports of the relevant commits from master.

cc @ofrobots @eugeneo

probably unrelated to the original issue: when I build/run debug version of node from master on Windows with the same repro - it always hits the assertion in element access inspector->buffer[inspector->data_len] at this line, because inspector->data_len is equal to buffer.size()

Not sure how to assign this to myself - I am planning to look into it tomorrow, once I get to the Windows PC.

I was unable to reproduce this. This is what I did:

  1. Ran node --inspect -e "while(1);"
  2. Copied the printed URL to Chrome browser.
  3. Tried suspending the target, printing values to the console, etc.
  4. I also tried refreshing the browser with the web tools, disconnecting and reconnecting, opening /json URLs.

My system is Windows 10. I build a release Node.js build (vcbuild nosign). I tested both master and v6.x branches.

Please provide detailed instruction if you still see this issue.

I have been using https://nodejs.org/dist/v6.4.0/node-v6.4.0-x64.msi off of the nodejs front page.

The node process crashes as soon as you try to load the page.

I can repro (100%) in Windows 10, both with v6.4.0 and the latest nightly. On Windows 2012 with a recent master build the debugger does not attach, nothing happens.

I'm running 6.4.0 and I too can repo 100% with the steps listed by @eugeneo and discovered this as I tried to use Node V8 Inspector

It doesn't matter what I'm running or if I use the URL provided in the console or the Chrome Extension, I get C:\Program Files\nodejs\node.exe: src\inspector_socket.cc:569: Assertion '(inspector->http_parsing_state) == (nullptr)' failed. each time.

UPDATE: I just upgraded to Node 6.5.0 and npm 3.10.7 and see the same behavior

The next release of v6.x should include this fix.

Is this supposed to be already available in nightly builds? I tried with v6.5.1-nightly20160906180867d6a6 and I still have the exact same error message:

C:\Program Files\nodejs\node.exe: src\inspector_socket.cc:569: Assertion `(inspector->http_parsing_state) == (nullptr)' failed.

PS: I can see it has been committed in master but I don't see any 6.6 available version, only a 6.5.1 and 7.0.0 in https://nodejs.org/download/nightly/

commented

@uggedal
As for Sep 8 2016 the same error
Win 10, 64
node v6.5.0 (includes npm 3.10.3)

mingw64_ 2016-09-08 14 09 50

@jbe456, @wzup: Node 6.5.0 doesn't have this fix yet and neither do the 6.x nightlies. I expect next release of v6.x (probably 6.6.0, which isn't out yet) will pick up this fix. /cc @Fishrock123.

@jbe456, @wzup Could you try with the latest 7.0 nightlies to see if the problem still exists?

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\BuSheeZy>node --inspect -e "while(1);"
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node
C:\Program Files\nodejs\node.exe: src\inspector_socket.cc:553: Assertion `(inspector->http_parsing_state) == (nullptr)' failed.

C:\Users\BuSheeZy>node -v
v7.0.0-nightly2016091353178f908f

C:\Users\BuSheeZy>

I know you asked for them but I gave it a go anyways.

I used this install:
https://nodejs.org/download/nightly/v7.0.0-nightly2016091353178f908f/node-v7.0.0-nightly2016091353178f908f-x64.msi

@ofrobots It still crashes here on node-v7.0.0-nightly2016091353178f908f-win-x64

src\inspector_socket.cc:553:` Assertion `(inspector->http_parsing_state) == (nullptr) failed.

Let me know if you need further testing,

If you're able to build node.js from source, could you try with the fix here: #8536. @eugeneo is unable to reproduce the failure and the previous excepted fix doesn't seem to fix the problem.

I can reproduce the crash as well.

Okay, so this seems to happen only with the official nightly builds. My own node builds on Windows do not crash.

Share that build? I'm dying for chrome devtools integration and don't have
a build environment yet.

On Sep 14, 2016 4:44 PM, "Ali Ijaz Sheikh" notifications@github.com wrote:

Okay, so this seems to happen only with the official nightly builds. My
own node builds on Windows do not crash.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8155 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAhynib0ry8S7Fa1tIUeJGP9RJ-UsC26ks5qqIbBgaJpZM4JnIxU
.

Compiling from the v7 branch seems to work. It doesn't crash. I'm not sure if the console window is supposed to reflect console.log output or not. The sources and profiler tab seem to work. Very cool. Thanks.

@rainabba I know you said you don't have an environment yet. I don't think it takes much to get if you don't mind waiting for the download and install. Sorry if you already know; someone else on google might want to see the steps. I would rather type this out than post an exe.

npm install --global --production windows-build-tools

Run that as admin and it should install everything you need. It will take a long time.

git clone https://github.com/nodejs/node.git
cd node
git checkout remotes/origin/v7.x
vcbuild nosign

Your node.exe will be in node/Release

@busheezy can you confirm you're building an x86_64 version of node?

I can't reproduce this bug on x86 / i386 at all, and 'vcbuild nosign' seems to default to it.

I feel silly. It seems that I built a x86 copy. I don't know why I thought it would default to 64.

Can folks try the latest nightly build: https://nodejs.org/download/nightly/v7.0.0-nightly201609202b5acda7a2/ and report back?

Windows 10 x64: tried both x86 and x64 versions of nightly - works fine 👍

Windows 7 x64:

v6.6.0 - error
v7.0.0-nightly201609202 - fixed

@busheezy I'm giving that a shot now. Your instructions will provide x86 though right? What needs to be changed for x64?

Also, the last few comments make me wonder if the crash was only ever in the x64 builds. Can anyone confirm? I'm using 6.2.2 in production so having to develop with >6.5 is already making me nervous enough, but I can't develop with 7.x and deploy to 6.2.2 (Elastic Beanstalk) so I'd like to see a fix in 6.x still even if 7.x is working.

@vladima, @ugate: awesome! Thanks for reporting back. I believe this is now fixed via #8536. The next version of v6.x (6.6.1 or 6.7.0, whichever happens first) should include the fix. In the meanwhile, you can use the v7.x nightly builds.

Let's keep this issue open for another day to get more feedback from the wild and make sure the issue is gone.

@rainabba for a 64-bit build on windows, use vcbuild nosign x64 instead of vcbuild nosign.

@ofrobots Thank you.

This experience led to the following PR because I spent more than an hour trying to figure out how to ensure I had vcbuild since it's no longer included in VS2015. I realised that the node project provides a .bat file (confusion that could have been avoided by using a different name, but I'm sure there's reason for that): #8704

I have built successfully, but not had a chance to confirm the issue on x86 vs x64 builds and still intend to when I can find time.

Thanks for fixing! Do bugs like this get ported down to patch older releases, like for a 6.3.1, 6.4.1 and so on, or will people just need to upgrade to 6.6.1 or 6.7.0 to get the fix?

This fix should be included in the upcoming 6.7.0 release. These don't typically get ported to patch older semver-minor releases.

Closing as fixed.

I can still repro the issue with 6.7.0 on Windows 10 64bit:

node --inspect --debug-brk .
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node
C:\nodejs\node.exe: src\inspector_socket.cc:553: Assertion `(inspector->http_parsing_state) == (nullptr)' failed.

Reopening as not fixed.

@misenesi @ofrobots According to the changlog it doesn't look like it was included in the 6.7.0 release?

v6.7.0 was a security release which is intended to be a minimal set of changes. @misenesi can you try the latest v7.x nightly release? I'm hoping that the next patch level release picks up the fix in #8536. Thanks for your patience.

@nodejs/release let me know if I should add any additional tags to make sure the fix gets released on the next v6.x.

I'm going to go ahead and get all the backlog of inspector commits onto v6.x-staging

edit: #8832

Anyone have a binary for Windows that is working which they could direct me to? I'm dying without debugging and in case it's been forgotten, node-inspector is broken too; I think because of the same issue. I built 7.x the other day and it was exhibiting the same issues, though that may have been the x86 and perhaps x64 is good?

Got --inspect and devtools working overall, but I don't get halts on breakpoints added in devtools. If I insert a debugger call, those do halt. Am I perhaps missing something or have bad expectations? I know this is a bit off-topic so if anyone wants to redirect me, I'd appreciate it.

Also, what is the best/least-ambiguous way to refer to this new --inspect/dev-tools debugger approach so it's not confused with node-inspector or devtool/Electron?

UPDATE: Was bit by a Chrome extension ( https://chrome.google.com/webstore/detail/nodejs-v8-inspector/lfnddfpljnhbneopljflpombpnkfhggl ). Instead of using the URL directly, I used this tool and the window I got didn't have the same behavior as one brought up manually.

I had the same error in my windows env (win7 x64).
And it was solved after installing node v7.0.0-nightly201609202b5acda7a2

@rainabba using breakpoints working aswell for me.

started debugging with node --inspect --debug-brk index.js

@thealphanerd how can we make sure we do not break the debugger anymore in a release? It's highly important for some people.

The inspector is listed as expiremental, if functionality changes here and there, that's kinda what you signed up for.

@Fishrock123 so, with node-inspector broken on v6.7.0, and the new "experimental" thing not working either, what should everyone be using?
As far as I know, the only one that is currently working is Visual Studio Code.

Isn't this issue only about the V8 inspector? Is node-inspector broken too?

commented

Node-inspector appears to be broken on Windows as well at the moment.

so, with node-inspector broken on v6.7.0, and the new "experimental" thing not working either, what should everyone be using?
As far as I know, the only one that is currently working is Visual Studio Code.

If it's a bug, we'll try to fix it as normal? If it's a bug in a specific release the choices are roll back a bit or build your own copy with patches... 😐 (like any other software...) sounds like @thealphanerd and I will get v6.x-staging updated with the necessary patches.

(Also like, if you don't think releases are frequent enough and would like to dedicated some time to help make releases, we'd be glad to have more people. Let me or any other CTC member know.)

@cjihrig node-debugger was broken last I checked around 6.4.x, but then again; it seems to be more often than not as long as I've been using it (since ~0.6.x I think and since 0.12.x for sure) which is why I was excited about a more official/integrated solution with the new approach.

I've not had to work so much without a debugger since gwbasic on DOS 3.0. I love node.js, but if I have a single complaint; it's the constant lack of debugging support and with --inspect in place, that should be resolved so I'm very much looking forward to it.

Just to clarify, there are three debuggers that can be easily confused:

  • v8-inspector - The new thing that uses --inspect, is integrated into Node, and is currently experimental.
  • node-inspector - The npm module.
  • Node's legacy debugger. This is the old debugger that is also integrated into Node.

Of course there are other debuggers like vscode, but those are the three that are most easily confused.

@cjihrig Thanks for the clarification. That does bring up a related issue to me; the lack of clarity on "how to debug in node". Because there are multiple approaches AND they seem to change regularly (due to constant advancement and I'm not complaining there), I feel like it's not clear to someone new, how to get the best debugging experience. Of course, that's just part of the game on a platform that's evolving so quickly, but once v8-inspector is stable, I'd love to see highly visible and clear documentation. That's something I might be willing and able to tackle even though I'm not sure I'm the most qualified (see my attempt at #8704).

Even if v8-inspector was stable and great documentation written, a real push would be needed to ensure it's discoverable to someone looking for it.

That said, anyone here have an article they'd recommend on the legacy debugger? For all the time I've spent looking for debugging tools, I'm not even sure I've run across the legacy one in a usable fashion. My understanding is that it was the power behind node-inspector, but it wasn't really usable by itself and if that's not true, I'd love to know.

Can someone confirm if this works on master or not?

commented

Just tested very briefly on Windows 10 and appears to be working. ❤️

Just tried on Microsoft Windows [Version 10.0.10586]

c:\git\test2>node --inspect=9222 --debug-brk index.js
Debugger listening on port 9222.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
  chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9222/node
C:\Program Files\nodejs\node.exe: src\inspector_socket.cc:553: Assertion `(inspector->http_parsing_state) == (nullptr)' failed.

c:\git\test2>node -v
v6.6.0

c:\git\test2>node --inspect=9222 --debug-brk index.js
Debugger listening on port 9222.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
  chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9222/node
C:\Program Files\nodejs\node.exe: src\inspector_socket.cc:553: Assertion `(inspector->http_parsing_state) == (nullptr)' failed.

c:\git\test2>node -v
v6.7.0

This PR - #8832 - should backport the fix. I believe this fix will be in v6.8.

I confirm it works with v6.8.0!