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

Process V8 profiler output not working (new v8.10.0) #19199

Open
antoniobusrod opened this issue Mar 7, 2018 · 19 comments

Comments

@antoniobusrod
Copy link

commented Mar 7, 2018

  • 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.

@antoniobusrod antoniobusrod changed the title Process V8 profiler not working (new v8.10.0) Process V8 profiler output not working (new v8.10.0) Mar 7, 2018
@addaleax addaleax added the v8.x label Mar 7, 2018
@addaleax

This comment has been minimized.

Copy link
Member

commented Mar 7, 2018

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

@MylesBorins

This comment has been minimized.

Copy link
Member

commented Mar 13, 2018

/cc @gibfahn

@gibfahn

This comment has been minimized.

Copy link
Member

commented Mar 14, 2018

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.

@guymguym

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2018

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...

@guymguym

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2018

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

@gibfahn

This comment has been minimized.

Copy link
Member

commented Mar 22, 2018

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

@psmarshall

This comment has been minimized.

Copy link
Contributor

commented Mar 29, 2018

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.

@antoniobusrod

This comment has been minimized.

Copy link
Author

commented Apr 2, 2018

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.

@charlesdarkwind

This comment has been minimized.

Copy link

commented Apr 8, 2018

@psmarshall thanks a lot!

@archcorsair

This comment has been minimized.

Copy link

commented May 1, 2018

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.

@psmarshall

This comment has been minimized.

Copy link
Contributor

commented May 4, 2018

@antoniobusrod

This comment has been minimized.

Copy link
Author

commented May 16, 2018

Hi, I've just tested with new v8.11.2, and I reproduced same results than previous comment #19199 (comment)

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

This comment has been minimized.

Copy link

commented May 20, 2018

@archcorsair weird your solution worked for me

@karliky

This comment has been minimized.

Copy link

commented Jun 7, 2018

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

@ofrobots

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2018

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.

@psmarshall

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2018

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.

@michaeltarleton

This comment has been minimized.

Copy link

commented Jul 1, 2018

@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.

@s-stark

This comment has been minimized.

Copy link

commented Jul 24, 2018

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

@MylesBorins MylesBorins self-assigned this Sep 12, 2018
@gtzinos

This comment has been minimized.

Copy link

commented Oct 3, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.