FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tracing: fix TracingController cleanup by jasongin · Pull Request #10623 · nodejs/node · GitHub

/ node Public

tracing: fix TracingController cleanup - #10623

Closed
jasongin wants to merge 1 commit into
nodejs:masterfrom
jasongin:tracing
Closed

tracing: fix TracingController cleanup#10623
jasongin wants to merge 1 commit into
nodejs:masterfrom
jasongin:tracing

Conversation

jasongin commented Jan 5, 2017

Copy link
Copy Markdown
Member

This fixes an incorrect deletion of the TracingController instance,
which in some environments could cause an error about an invalid
pointer passed to free(). The TracingController instance is
actually owned by a unique_ptr member of the platform, so calling
platform::SetTracingController(nullptr) is the correct way to
delete it. But before that, the TraceBuffer must be deleted in
order for the tracing loop to exit; that is accomplished by calling
TracingController::Initialize(nullptr).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

tracing

This fixes an incorrect deletion of the `TracingController` instance,
which in some environments could cause an error about an invalid
pointer passed to `free()`. The `TracingController` instance is
actually owned by a `unique_ptr` member of the platform, so calling
`platform::SetTracingController(nullptr)` is the correct way to
delete it. But before that, the `TraceBuffer` must be deleted in
order for the tracing loop to exit; that is accomplished by calling
`TracingController::Initialize(nullptr)`.
nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v7.x labels Jan 5, 2017
jasongin mentioned this pull request Jan 5, 2017
2 tasks

jasongin commented Jan 5, 2017

Copy link
Copy Markdown
Member Author

This fixes the failure reported here: #9618 (comment)

Copy link
Copy Markdown

LGTM. Thank you for investigating this @jasongin

targos commented Jan 6, 2017
edited
Loading

Copy link
Copy Markdown
Member

kjin commented Jan 6, 2017

Copy link
Copy Markdown
Contributor

Thanks for fixing this!

Copy link
Copy Markdown
Contributor

LGTM too

targos pushed a commit that referenced this pull request Jan 7, 2017
This fixes an incorrect deletion of the `TracingController` instance,
which in some environments could cause an error about an invalid
pointer passed to `free()`. The `TracingController` instance is
actually owned by a `unique_ptr` member of the platform, so calling
`platform::SetTracingController(nullptr)` is the correct way to
delete it. But before that, the `TraceBuffer` must be deleted in
order for the tracing loop to exit; that is accomplished by calling
`TracingController::Initialize(nullptr)`.

PR-URL: #10623
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>

targos commented Jan 7, 2017

Copy link
Copy Markdown
Member

Landed in 58c38c2. Thank you!

targos closed this Jan 7, 2017
mscdex added the trace_events Issues and PRs related to V8, Node.js core, and userspace code trace events. label Jan 29, 2017

Copy link
Copy Markdown
Contributor

Marking don't land since it depends on #9304

targos pushed a commit to targos/node that referenced this pull request Mar 1, 2017
This fixes an incorrect deletion of the `TracingController` instance,
which in some environments could cause an error about an invalid
pointer passed to `free()`. The `TracingController` instance is
actually owned by a `unique_ptr` member of the platform, so calling
`platform::SetTracingController(nullptr)` is the correct way to
delete it. But before that, the `TraceBuffer` must be deleted in
order for the tracing loop to exit; that is accomplished by calling
`TracingController::Initialize(nullptr)`.

PR-URL: nodejs#10623
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Mar 1, 2017
This fixes an incorrect deletion of the `TracingController` instance,
which in some environments could cause an error about an invalid
pointer passed to `free()`. The `TracingController` instance is
actually owned by a `unique_ptr` member of the platform, so calling
`platform::SetTracingController(nullptr)` is the correct way to
delete it. But before that, the `TraceBuffer` must be deleted in
order for the tracing loop to exit; that is accomplished by calling
`TracingController::Initialize(nullptr)`.

PR-URL: nodejs#10623
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
italoacasas mentioned this pull request Mar 1, 2017

jasnell commented Mar 7, 2017

Copy link
Copy Markdown
Member

Marking as don't land on 4 and 6 given that it apparently depends on #9304.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. trace_events Issues and PRs related to V8, Node.js core, and userspace code trace events.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL