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

Fixed support for Node 8.12.0. #172

Merged
merged 1 commit into from
Sep 19, 2018
Merged

Fixed support for Node 8.12.0. #172

merged 1 commit into from
Sep 19, 2018

Conversation

mcollina
Copy link
Collaborator

No description provided.

@@ -22,8 +43,11 @@ function v8LogToTicks (isolateLogPath, node) {
// it's an error in the V8 internal tick profiler)
// ignore them.
const ignore = /unknown code state:/
// pump(sp.stderr, process.stderr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsolete comment? :)


module.exports = process

function process (isolateLogPath, node) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a different name? Having the same name as global seems not ideal.

module.exports = process

function process (isolateLogPath, node) {
return filterLinesThatAreTooLong(isolateLogPath).then((filtered) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to only execute this when it's necessary (by checking the Node.js version).

return readFile(isolateLogPath, 'utf8').then((data) => {
data = data.split('\n').filter((s) => s.length < 1024).join('\n')
return writeFile(dest, data)
}).then(() => dest)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: use async / await.

@mcollina
Copy link
Collaborator Author

PTAL

Copy link
Contributor

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (even though I would still argue it that only doing it in 8 and not in 10 where it's already fixed would be best).

@mcollina
Copy link
Collaborator Author

Those lines cause the processor to fail, and we silence that error. I think this is just avoid future problems.

@zbjornson
Copy link

zbjornson commented Oct 17, 2018

@mcollina this doesn't seem to always fix the problem -- I'm still getting the error with lines > 1024 characters removed. Maybe something else besides long lines causes printErr to be invoked?

My workaround was to evaluate https://github.com/nodejs/node/blob/2ae98ce7cb95dee79e839afb2ee4c7d77d7670cd/lib/internal/v8_prof_processor.js in a new JS file, and the errors that were logged were all Code move event for unknown code: 0xxxxxxxxxxx.

@mcollina
Copy link
Collaborator Author

mcollina commented Oct 17, 2018 via email

@zbjornson
Copy link

Here's one: isolate-0x3aad0c0-v8.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants