Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Reported Node.js version is incorrect #29

Closed
richardlau opened this issue Nov 24, 2016 · 4 comments
Closed

Reported Node.js version is incorrect #29

richardlau opened this issue Nov 24, 2016 · 4 comments

Comments

@richardlau
Copy link
Member

Reports currently contain in the NodeReport section:

Node.js version: v6.9.1
(v8: 5.1.281.84, libuv: 1.9.1, zlib: 1.2.8, ares: 1.10.1-DEV)

If I compile nodereport with one version of Node.js (e.g. v6.9.1) and then run on another version (e.g. v6.7.0) the report incorrectly reports v6.9.1 and not v6.7.0 (note that it correctly reports v8: 5.1.281.83):

-bash-4.2$ node
> process.versions
{ http_parser: '2.7.0',
  node: '6.7.0',
  v8: '5.1.281.83',
  uv: '1.9.1',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '57.1',
  modules: '48',
  openssl: '1.0.2j' }
> require('.').triggerReport()

Writing Node.js report to file: NodeReport.20161124.151013.8560.001.txt
Node.js report completed
'NodeReport.20161124.151013.8560.001.txt'
> .exit
-bash-4.2$ head -20 NodeReport.20161124.151013.8560.001.txt
================================================================================
==== NodeReport ================================================================

Event: JavaScript API, location: "TriggerReport"
Filename: NodeReport.20161124.151013.8560.001.txt
Dump event time:  2016/11/24 15:10:13
Module load time: 2016/11/24 15:10:13
Process ID: 8560

Node.js version: v6.9.1
(v8: 5.1.281.83, libuv: 1.9.1, zlib: 1.2.8, ares: 1.10.1-DEV)

OS version: Linux 3.10.0-327.18.2.el7.x86_64 #1 SMP Fri Apr 8 05:09:53 EDT 2016
(glibc: 2.17)

Machine: drx-hemera x86_64

================================================================================
==== JavaScript Stack Trace ====================================================

-bash-4.2$

Looks like compile time constants are being used in src/nodereport.cc:

static void PrintVersionInformation(FILE* fp) {

  // Print Node.js and deps component versions
  fprintf(fp, "\nNode.js version: %s\n", NODE_VERSION);
  fprintf(fp, "(v8: %s, libuv: %s, zlib: %s, ares: %s)\n",
          V8::GetVersion(), uv_version_string(), ZLIB_VERSION, ARES_VERSION_STR);

zlib and ares versions are also at risk of being incorrectly reported.

Pull request incoming.

richardlau added a commit to richardlau/nodereport that referenced this issue Nov 24, 2016
Report the versions of Node.js and its components based on the runtime
and not compile time constants.

Extend the tests to validate the versions reported in the report.

Fixes: nodejs#29
richardlau added a commit to richardlau/nodereport that referenced this issue Nov 24, 2016
Report the versions of Node.js and its components based on the runtime
and not compile time constants.

Extend the tests to validate the versions reported in the report.

Fixes: nodejs#29
richardlau added a commit to richardlau/nodereport that referenced this issue Nov 25, 2016
Report the versions of Node.js and its components based on the runtime
and not compile time constants.

Extend the tests to validate the versions reported in the report.

Fixes: nodejs#29
@sam-github
Copy link
Contributor

Good catch!

@sam-github
Copy link
Contributor

I wonder if reporting the version nodereport was built against, distinct from the run version, would be useful?

@richardlau
Copy link
Member Author

Perhaps. The report doesn't actually include the version of nodereport itself, so maybe something like nodereport v1.0.6 built against Node.js v6.9.1?

@sam-github
Copy link
Contributor

Sounds good to me.

richardlau added a commit to richardlau/nodereport that referenced this issue Nov 25, 2016
Report the versions of Node.js and its components based on the runtime
and not compile time constants.

Extend the tests to validate the versions reported in the report.

Fixes: nodejs#29
richardlau added a commit to richardlau/nodereport that referenced this issue Nov 29, 2016
Report the versions of Node.js and its components based on the runtime
and not compile time constants. Report NodeReport version and the
version of Node.js it was built against.

Extend the tests to validate the versions reported in the report.

Fixes: nodejs#29
richardlau added a commit to richardlau/nodereport that referenced this issue Nov 29, 2016
Report the versions of Node.js and its components based on the runtime
and not compile time constants. Report NodeReport version and the
version of Node.js it was built against.

Extend the tests to validate the versions reported in the report.

Fixes: nodejs#29
richardlau added a commit to richardlau/nodereport that referenced this issue Dec 8, 2016
Report the versions of Node.js and its components based on the runtime
and not compile time constants. Report NodeReport version and the
version of Node.js it was built against.

Extend the tests to validate the versions reported in the report.

Fixes: nodejs#29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants