Node: Process V8 profiler output not working (new v8.10.0)

Created on 7 Mar 2018  Â·  20Comments  Â·  Source: nodejs/node

  • Version: v8.10.0
  • Platform: linux x64
  • Subsystem: Ubuntu 17.10 artful

After generate log statistical profiling information (node --prof), process V8 profiler output generated (node --prof-process isolate-0xnnnnnnnnnnnn-v8.log) doesn't output anything to standard ouput. It seems it consumes almost all CPU available.

I've been testing with example from Easy profiling for Node.js Applications.

It works fine with previous v8.9.4 version. You can use Simple profiling repository to test it.

help wanted

Most helpful comment

It looks like the .log files produced by node v8.9.4 have a newline at the end, and the ones produced by v8.10.0 don't.

I built a debug build of v8.10.0 and interrupted it in the debugger while it was hanging. It seems to be calling filesystem read in an infinite loop. I guess something expects a newline at the end of the file.

None of the log files I can generate to cause the hanging end with 0xa and all of the ones that work end with 0xa.

Not sure where that expectation is happening though, also not sure whether the v8 profiler output changed or if node itself writes the file.

All 20 comments

I guess that makes the V8 6.2 update a prime candidate for causing this … /cc @nodejs/v8

/cc @gibfahn

It works fine with previous v8.9.4 version. You can use Simple profiling repository to test it.

Can you explain more about how to reproduce with that repository?

This is what I get when I run the steps from the readme on a vagrant box (on a macOS machine):

Node v8.10.0

image

Node v8.9.4

image

I set up the VM with:

vagrant init ubuntu/artful64
vagrant up
vagrant ssh

And then used nvm to install node 8.10.0.

One observation that might help:

The issue happens when I use node --prof with v8.10.0 to record the profiling information and then --prof-process gets stuck with either v8.10.0 or v8.9.4.

However, when I use v8.9.4 to create the profiler file, both versions succeed with --prof-process...

any idea how to push this forward?
more info needed?

I think we need someone from the V8 team to take a look at it (cc/ @nodejs/v8 again).

It looks like the .log files produced by node v8.9.4 have a newline at the end, and the ones produced by v8.10.0 don't.

I built a debug build of v8.10.0 and interrupted it in the debugger while it was hanging. It seems to be calling filesystem read in an infinite loop. I guess something expects a newline at the end of the file.

None of the log files I can generate to cause the hanging end with 0xa and all of the ones that work end with 0xa.

Not sure where that expectation is happening though, also not sure whether the v8 profiler output changed or if node itself writes the file.

Hi @psmarshall is right, I've repeated the test using v8.11.1 and it failed as I described in this issue. However, If I manually add an empty line at the end of isolate-0xnnnnnnnnnnnn-v8.log, it works.

@psmarshall thanks a lot!

Ran into the same issue, checked the isolate-0xnnnnnnnnnnnn-v8.log file for a missing newline. Interestingly, mine already had a newline... So I added another and it worked fine after! Strange, but thought I'd share.

@davidmarkclements FYI

Hi, I've just tested with new v8.11.2, and I reproduced same results than previous comment https://github.com/nodejs/node/issues/19199#issuecomment-377943343

  • Version: v8.11.2
  • Platform: linux x64
  • Subsystem: Ubuntu 18.04 LTS bionic

@archcorsair weird your solution worked for me

@archcorsair thanks! That's the fix for Node v8.x

I think this issue needs some investigation on what code has changed (v8 vs. node) that causes the newline to be missing. Adding the 'help wanted' label.

I just tried to reproduce this on mac and I couldn't, it seems people commenting here who reproduced it did so on linux. Not sure why that's the case but I can take a look next week when I have access to my linux machine again.

@psmarshall I have reproduced it on my mac.
macOS: 10.13.5
node: v8.11.3

The newline fixed the issue for me as well.

It's not just a simple missing newline for me. The last line in the log file is actually incomplete after CTRL-C'ing.
Likely meaning the process is abruptly terminating instead of flushing the rest of the line and a newline.

os: Ubuntu 16.04, node: v8.11.3

I have reproduced it on my linux.
ubuntu version: 16.04
node: v8.11.4

Node.js v8.x has reached the end-of-life and won't receive any fixes anymore. I am closing this since this issue seems to only apply to Node.js v8.x. If it does apply to newer versions as well, please leave a comment so that this can be reopened. No matter if you run into this issue or not, please update to a newer Node.js version in case you still use v8.x.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filipesilvaa picture filipesilvaa  Â·  3Comments

fanjunzhi picture fanjunzhi  Â·  3Comments

dfahlander picture dfahlander  Â·  3Comments

vsemozhetbyt picture vsemozhetbyt  Â·  3Comments

cong88 picture cong88  Â·  3Comments