Skip to content

VTune breaking Node.JS issue has been fixed in V8 repo, but the fix patch was not cherry-picked by Node.JS repo #29060

Closed

Description

@lucshi
  • Version:
    v13.0.0-pre

  • Platform:
    4.18.0-25-generic GitHub issue management #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

  • Subsystem:
    JIT

  • Issue:
    VTune profiling is removed from Node.js due to its broken support (commit: 88bac02).

This problem has been fixed in V8 (commit: f044f91d87f80d59b4a65799149fa38fa6d67cd7). However Node didn’t cherry-pick this patch.

The root cause of this issue was that, when VTune JIT support is enabled, the WasmEngine of an Isolate tries to enable code logging by EnableCodeLogging() method. This multithreaded method requires a Mutex for safety. However, as the WasmEngine is not created, the Mutex of it is not initialized. An attempt of acquiring this Mutex results in an error. The bug is fixed by creating WasmEngine before it enables code logging.

The fix was that,

   if (event_handler) {
-    isolate_->wasm_engine()->EnableCodeLogging(isolate_);
+    if (isolate_->wasm_engine() != nullptr) {
+      isolate_->wasm_engine()->EnableCodeLogging(isolate_);
+    }
     jit_logger_.reset(new JitLogger(isolate_, event_handler));
     AddCodeEventListener(jit_logger_.get());
     if (options & kJitCodeEventEnumExisting) {

Tracked by:

Change-Id: I59e749190288ec412f6661233e8f62b0dff3cd7f
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1337376
    Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#60060}

VTune is a useful tool to profile Node app performance bottleneck and microarchitecture breakdown. Could you please review this issue and cherry-pick the patch to re-enable VTune profiling in Node.JS? Thank you.

Activity

  1. bnoordhuis commented on Aug 9, 2019

    @bnoordhuis
    Member

    You're welcome to open a pull request.

    The reason I opted for removing instead of fixing it is that it had been broken (as in: didn't build) for quite some time without anyone complaining, suggesting no one actually uses it.

    v8/v8@f044f91 fixes a run-time error, not a build-time error.

  2. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    feature requestIssues requesting new Node.js features.
    wontfixIssues that will not be fixed.
    on Aug 9, 2019
  3. bnoordhuis commented on Aug 14, 2019

    @bnoordhuis
    Member

    I'll close this out. You're still welcome to file a pull request if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.feature requestIssues requesting new Node.js features.wontfixIssues that will not be fixed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions